/* Digital Footprints Reporting — brand-styled dashboard.
   Client palette is injected inline via template so different clients
   can override. Defaults here are for Sportingtech (client #1). */

:root {
  --coral: #FF4F40;
  --teal: #00D8AE;
  --black: #000000;
  --white: #FFFFFF;
  --lime: #B6EC2D;
  --blue: #0069C4;
  --hero: var(--coral);
  --accent: var(--teal);
  --accent-strong: #00A07F;
  --negative: #C24025;
  --grey-50: #F8F8F8;
  --grey-100: #F4F4F4;
  --grey-200: #EAEAEA;
  --grey-400: #999;
  --grey-600: #666;
  --grey-800: #222;
  --border: rgba(0, 0, 0, 0.08);

  --font-heading: 'Aptos', 'Aptos Black', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Aptos', 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--grey-800);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* -------- Top bar -------- */
.topbar {
  background: var(--black);
  color: var(--white);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 15px;
}
.topbar__brand .accent { color: var(--teal); }
.topbar__breadcrumbs {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #888;
  font-weight: 600;
}
.topbar__meta { font-size: 12px; color: #aaa; }
.topbar__actions { display: flex; gap: 10px; }
.topbar__link {
  font-size: 12px;
  color: #aaa;
  border: 0.5px solid #333;
  padding: 6px 12px;
  border-radius: 4px;
}
.topbar__link:hover { color: var(--white); border-color: #555; }

/* -------- Hero -------- */
.hero {
  background: var(--hero);
  color: var(--white);
  padding: 48px 32px 56px;
  position: relative;
  overflow: hidden;
}
.hero__chevrons {
  position: absolute;
  top: -10px;
  right: -20px;
  opacity: 0.4;
  pointer-events: none;
}
.hero__label {
  font-size: 13px;
  letter-spacing: 0.24em;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 10px;
}
.hero__title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-style: italic;
  font-size: 64px;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0;
}
.hero__brandline {
  font-weight: 700;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 20px;
  opacity: 0.95;
}

/* -------- KPI strip -------- */
.kpis {
  background: var(--grey-100);
  padding: 24px 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.kpi {
  background: var(--white);
  padding: 16px 18px;
  border-radius: 6px;
  border-top: 3px solid var(--accent);
}
.kpi--negative { border-top-color: var(--coral); }
.kpi__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--grey-600);
  text-transform: uppercase;
  font-weight: 700;
}
.kpi__value {
  font-size: 30px;
  font-weight: 800;
  color: var(--black);
  margin-top: 6px;
  line-height: 1;
}
.kpi__value .unit { font-size: 16px; color: var(--grey-600); font-weight: 600; }
.kpi__trend {
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
}
.kpi__trend--up { color: var(--accent-strong); }
.kpi__trend--down { color: var(--negative); }
.kpi__trend--flat { color: var(--grey-600); }

/* -------- Sections -------- */
.section {
  padding: 32px;
  border-bottom: 0.5px solid var(--border);
}
.section__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.section__rule {
  width: 28px;
  height: 5px;
  background: var(--coral);
}
.section__title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-style: italic;
  font-size: 20px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--black);
  margin: 0;
}
.section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.section__col-full { grid-column: 1 / -1; }

.section__subhead {
  font-size: 11px;
  color: var(--grey-600);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

/* -------- Tables / lists -------- */
.rows { font-size: 13px; color: var(--grey-800); }
.rows__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--grey-200);
}
.rows__row:last-child { border-bottom: none; }
.rows__value { font-weight: 700; }

/* -------- Bar rows (for share breakdowns) -------- */
.bars { font-size: 12px; color: var(--grey-800); }
.bars__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.bars__label { width: 96px; font-size: 12px; }
.bars__track {
  flex: 1;
  height: 8px;
  background: var(--grey-200);
  border-radius: 2px;
  overflow: hidden;
}
.bars__fill { height: 100%; background: var(--accent); }
.bars__fill--hero { background: var(--hero); }
.bars__value {
  font-size: 11px;
  width: 44px;
  text-align: right;
  font-weight: 700;
}

/* -------- Sentiment -------- */
.sentiment-mix {
  display: flex;
  gap: 4px;
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 16px;
}
.sentiment-mix__pos { background: var(--accent); }
.sentiment-mix__neu { background: var(--grey-400); }
.sentiment-mix__neg { background: var(--coral); }

.sentiment-legend {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--grey-600);
}
.sentiment-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* -------- Actions section (next month) -------- */
.actions-block {
  background: var(--black);
  color: var(--white);
  padding: 40px 32px;
}
.actions-block .section__title { color: var(--white); }
.actions-block .section__rule { background: var(--teal); }
.actions-block .subhead {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
  margin: 20px 0 10px;
}
.actions-block .subhead--fix { color: var(--coral); }
.action-item {
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
}
.action-item:last-child { border-bottom: none; }
.action-item__what {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.action-item__why {
  font-size: 12px;
  color: #aaa;
  line-height: 1.5;
}

/* -------- Footer -------- */
.footer {
  background: var(--black);
  color: var(--white);
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.footer__mark {
  letter-spacing: 0.12em;
  font-weight: 700;
  opacity: 0.6;
}
.footer__prepared { display: flex; align-items: center; gap: 10px; }
.footer__by { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.5; font-weight: 700; }
.footer__logo { height: 26px; width: auto; display: block; }
.footer__actions { display: flex; gap: 10px; }
.footer__btn {
  border: 0.5px solid #555;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 11px;
  cursor: pointer;
}
.footer__btn--primary {
  background: var(--coral);
  color: var(--white);
  border-color: var(--coral);
  font-weight: 700;
}

/* -------- Empty / not-configured states -------- */
.muted {
  color: var(--grey-400);
  font-size: 13px;
  font-style: italic;
}
/* Operator-only hint shown on the review screen, never published */
.muted--internal {
  border: 1px dashed var(--grey-200);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--grey-50);
}

/* -------- Admin pages -------- */
.admin-shell {
  min-height: 100vh;
  background: var(--grey-50);
}
.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px;
}
.admin-card {
  background: var(--white);
  border-radius: 8px;
  border: 0.5px solid var(--border);
  padding: 28px;
  margin-bottom: 20px;
}
.admin-card h2 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: 20px;
  letter-spacing: 0.02em;
  margin: 0 0 20px;
}
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 12px;
  color: var(--grey-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 6px;
}
.form-row input, .form-row select {
  width: 100%;
  padding: 10px 12px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.btn {
  background: var(--coral);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
}
.btn:hover { background: #E63E30; }
.btn--secondary {
  background: transparent;
  color: var(--black);
  border: 0.5px solid var(--border);
}

.upload-drop {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  color: var(--grey-600);
  background: var(--grey-50);
}
.upload-drop input[type=file] { margin-top: 12px; }

.error {
  background: #FEE7E4;
  color: var(--negative);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}
.success {
  background: #E0F7EF;
  color: var(--accent-strong);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* -------- Technical SEO section -------- */
.tseo-baseline {
  background: var(--grey-100);
  border-left: 3px solid var(--accent);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--grey-600);
  font-style: italic;
  margin-bottom: 20px;
  border-radius: 0 4px 4px 0;
}

.tseo-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}
.tseo-kpi {
  background: var(--grey-100);
  border-radius: 6px;
  padding: 14px 16px;
  border-top: 3px solid var(--accent);
}
.tseo-kpi__label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--grey-600);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
}
.tseo-kpi__value {
  font-size: 26px;
  font-weight: 800;
  color: var(--black);
  line-height: 1.1;
}
.tseo-kpi__unit { font-size: 14px; color: var(--grey-600); font-weight: 600; }
.tseo-kpi__sub { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }

/* delta chips */
.tseo-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  margin-left: 6px;
  vertical-align: middle;
}
.tseo-chip--up   { background: #E0F7EF; color: var(--accent-strong); }
.tseo-chip--down { background: #FEE7E4; color: var(--negative); }
.tseo-chip--flat { background: var(--grey-200); color: var(--grey-600); }

/* severity badges */
.tseo-sev {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  display: inline-block;
}
.tseo-sev--high   { background: #FEE7E4; color: var(--negative); }
.tseo-sev--medium { background: #FFF3E0; color: #B45309; }
.tseo-sev--low    { background: var(--grey-200); color: var(--grey-600); }

/* issues table */
.tseo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}
.tseo-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-600);
  padding: 8px 10px;
  border-bottom: 1px solid var(--grey-200);
}
.tseo-table__row {
  border-bottom: 0.5px solid var(--grey-200);
  page-break-inside: avoid;
}
.tseo-table__row:last-child { border-bottom: none; }
.tseo-table td {
  padding: 9px 10px;
  vertical-align: top;
  line-height: 1.4;
}
.tseo-table__id { font-weight: 700; color: var(--grey-600); font-size: 11px; }

.tseo-low-summary {
  margin-top: 10px;
  font-size: 11px;
  color: var(--grey-600);
  font-style: italic;
  padding: 6px 12px;
  background: var(--grey-100);
  border-radius: 4px;
  display: inline-block;
}

/* -------- Upload card grid -------- */
.source-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.source-card {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
}

.source-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.source-card__title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-style: italic;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--black);
}

.source-card__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.source-card__dot--empty    { background: var(--grey-200); }
.source-card__dot--uploading{ background: var(--grey-400); }
.source-card__dot--ok       { background: var(--teal); }
.source-card__dot--warning  { background: #F59E0B; }
.source-card__dot--error    { background: var(--coral); }

.source-card__purpose {
  font-size: 12px;
  color: var(--grey-600);
  margin-bottom: 4px;
}

.source-card__cols {
  font-size: 11px;
  color: var(--grey-400);
  font-family: monospace;
  margin-bottom: 12px;
}

.source-card__drop {
  border: 1.5px dashed var(--grey-200);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.source-card__drop:hover,
.source-card__drop--active  { border-color: var(--teal); background: #F0FDFB; }
.source-card__drop--uploading { border-color: var(--grey-400); background: var(--grey-50); }

.source-card__prompt {
  font-size: 12px;
  color: var(--grey-600);
}
.source-card__browse-link { color: var(--teal); text-decoration: underline; cursor: pointer; }
.source-card__file { display: none; }

.source-card__status { margin-top: 10px; min-height: 18px; }
.status-filename { display: block; font-size: 11px; color: var(--grey-600); margin-bottom: 2px; }
.status-summary { display: block; font-size: 12px; font-weight: 600; }
.status-summary--ok      { color: var(--accent-strong); }
.status-summary--warning { color: #B45309; }
.status-summary--error   { color: var(--negative); }
.status-warning { display: block; font-size: 11px; color: #B45309; margin-top: 2px; }

.upload-actions {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 24px;
}
.upload-actions form {
  display: flex;
  gap: 12px;
  align-items: center;
}
.upload-actions__hint {
  font-size: 12px;
  color: var(--grey-400);
}

/* -------- Editable commentary -------- */
.hero__standfirst {
  max-width: 620px;
  margin: 18px auto 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--grey-600);
  text-align: center;
}

.section__note {
  margin: 4px 0 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--teal);
  background: #F0FDFB;
  font-size: 13px;
  line-height: 1.5;
  color: var(--grey-800);
  border-radius: 0 6px 6px 0;
}

/* Media mention links */
.mention-link {
  font-weight: 600;
  font-size: 13px;
  color: var(--teal);
  text-decoration: none;
}
.mention-link:hover { text-decoration: underline; }
.mention-link--muted { color: #888; font-weight: 400; }

/* -------- In-situ editing (review screen renders the real report) -------- */
.edit-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--black);
  color: var(--white);
  flex-wrap: wrap;
}
.edit-bar__label { font-size: 13px; font-weight: 600; }
.edit-bar__actions { display: flex; gap: 12px; }
.edit-message {
  padding: 10px 24px;
  background: #F0FDFB;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
}
.edit-tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--grey-600);
  background: var(--grey-100);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.edit-tag--hero { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.15); margin-top: 12px; }
.hero__title-input {
  display: block;
  width: 100%;
  max-width: 620px;
  margin: 6px auto 0;
  padding: 8px 12px;
  border: 1px dashed rgba(255,255,255,0.5);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 900;
  font-style: italic;
  font-size: 32px;
  text-align: center;
}
.hero__standfirst-input {
  display: block;
  width: 100%;
  max-width: 620px;
  margin: 6px auto 0;
  padding: 8px 12px;
  border: 1px dashed rgba(255,255,255,0.5);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  font-family: inherit;
  resize: vertical;
}
.hero__title-input::placeholder,
.hero__standfirst-input::placeholder { color: rgba(255,255,255,0.5); }
.section__note--edit {
  background: #FFFDF5;
  border-left-color: #F59E0B;
}
.section__note--edit textarea {
  width: 100%;
  padding: 8px 10px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
}

/* -------- Review & edit commentary screen -------- */
.review-field { margin-bottom: 22px; }
.review-field label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 900;
  font-style: italic;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--black);
  margin-bottom: 6px;
}
.review-field .hint {
  font-size: 12px;
  color: var(--grey-600);
  font-weight: 400;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 8px;
}
.review-field input[type="text"],
.review-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
}
.review-rec {
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--grey-50);
}
.review-rec__bucket {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-600);
  margin-bottom: 8px;
}
.rec-slot {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 0.5px solid var(--border);
}
.rec-slot:first-of-type { border-top: 0; padding-top: 4px; }
.rec-slot__num {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  border: 0.5px solid var(--border);
  color: var(--grey-600);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}
.rec-slot__fields { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.rec-slot__fields input { width: 100%; display: block; }
.rec-slot__fields input:first-child { font-weight: 600; }
.rec-slot__fields input {
  padding: 9px 12px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

/* -------- Print (PDF export) -------- */
@media print {
  @page { size: A4; margin: 0; }
  .topbar__actions, .footer__actions { display: none; }
  .edit-bar, .edit-message, .edit-tag { display: none; }
  .section { page-break-inside: avoid; }
  .tseo-table tr, .kpi, .action-item { page-break-inside: avoid; }
  .footer { page-break-inside: avoid; }
  a { text-decoration: none; }
  body { background: var(--white); }
}
