:root {
  --color-background: #1D1D1B;
  --color-primary: #FFFFFF;
  --color-accent: #E5E5E5;
  --color-muted: #AFAFAF;
  --color-hover: #1D1D1B;
  --color-burgundy: #522446;
  --color-rose: #88304E;
  --color-coral: #F63750;
}

body {
  background-color: var(--color-background);
  color: var(--color-primary);
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
}


.sidebar {
  background-color: rgba(29, 29, 27, 0.6);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  gap: 0.85rem;
  backdrop-filter: blur(8px);
}

.sidebar__logo {
  display: block;
  width: 150px;
  height: auto;
  margin: 0 auto 0.3rem;
}

.sidebar__nav {
  display: block;
}

.sidebar__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar__nav-item {
  margin: 0;
}

.sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.65rem 0.95rem 0.65rem 1.1rem;
  border-radius: 12px;
  transition: background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
  background-color: transparent;
}

.sidebar__link::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.25);
  transition: transform 0.22s ease, background-color 0.22s ease;
}

.sidebar__link-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.sidebar__link:hover,
.sidebar__link:focus {
  background-color: rgba(255, 255, 255, 0.18);
  color: var(--color-primary);
  transform: translateX(6px);
}

.sidebar__link:hover::before,
.sidebar__link:focus::before {
  background-color: var(--color-primary);
  transform: scale(1.6);
}

.sidebar__link--active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.18));
  color: var(--color-primary);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  transform: translateX(8px);
  font-weight: 700;
}

.sidebar__link--active::before {
  background-color: var(--color-primary);
  transform: scale(1.9);
}

.sidebar__logout {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.sidebar__logout button {
  width: 100%;
  background: rgba(29, 29, 27, 0.65);
  color: var(--color-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sidebar__logout button:hover {
  background-color: rgba(255, 255, 255, 0.18);
  color: var(--color-primary);
}

.sidebar__quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.sidebar__quick-action {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(29, 29, 27, 0.4);
  color: var(--color-primary);
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar__quick-action:hover,
.sidebar__quick-action:focus,
.sidebar__quick-action--active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.sidebar__quick-action i {
  font-size: 1.3rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 6px;
  background-color: transparent;
  border: 1px solid rgba(29, 29, 27, 0.2);
  color: var(--color-background);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-icon:hover {
  background-color: var(--color-burgundy);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(82, 36, 70, 0.3);
  border-color: var(--color-burgundy);
}

.btn-icon svg {
  display: block;
}
.sidebar__quick-action--active {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.channel-icons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background-color: var(--color-burgundy);
  color: var(--color-primary);
}

.channel-icon i {
  font-size: 1rem;
  line-height: 1;
}

/* ── Operations UI ─────────────────────────────────────────────────────────
   Severity is encoded in form as well as colour (a dot plus a label), so a
   stuck post reads at a glance and stays legible to anyone who cannot rely on
   hue alone. */

.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-line;
}
.flash--success {
  background-color: rgba(39, 174, 96, 0.12);
  border: 1px solid rgba(39, 174, 96, 0.4);
  color: #1c6b3f;
}
.flash--error {
  background-color: rgba(246, 55, 80, 0.1);
  border: 1px solid rgba(246, 55, 80, 0.4);
  color: #a11228;
}
.flash--info {
  background-color: rgba(82, 36, 70, 0.08);
  border: 1px solid rgba(82, 36, 70, 0.3);
  color: var(--color-burgundy);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.chip--ok     { background: rgba(39,174,96,.12);  border-color: rgba(39,174,96,.35);  color: #1c6b3f; }
.chip--warn   { background: rgba(242,153,74,.14); border-color: rgba(242,153,74,.4);  color: #8a4b0f; }
.chip--danger { background: rgba(246,55,80,.1);   border-color: rgba(246,55,80,.4);   color: #a11228; }
.chip--info   { background: rgba(82,36,70,.08);   border-color: rgba(82,36,70,.3);    color: var(--color-burgundy); }
.chip--muted  { background: rgba(29,29,27,.06);   border-color: rgba(29,29,27,.18);   color: rgba(29,29,27,.6); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-tile {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(82,36,70,.14);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  box-shadow: 0 10px 28px rgba(82,36,70,.06);
}
.stat-tile__value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-background);
  font-variant-numeric: tabular-nums;
}
.stat-tile__label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(29,29,27,.55);
  margin-top: .35rem;
}
.stat-tile--alert .stat-tile__value { color: #a11228; }
.stat-tile--alert { border-color: rgba(246,55,80,.35); }

.ops-table td { vertical-align: top; font-size: .9rem; }
.ops-table .reason {
  max-width: 30rem;
  color: rgba(29,29,27,.7);
  font-size: .85rem;
  line-height: 1.45;
}
.ops-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.ops-actions form { display: inline; flex-direction: row; gap: 0; }
.btn-sm {
  padding: .35rem .75rem;
  font-size: .8rem;
  border-radius: 6px;
  border: 1px solid rgba(29,29,27,.2);
  background: rgba(29,29,27,.05);
  color: var(--color-background);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
.btn-sm:hover { background: var(--color-background); color: #fff; }
.btn-sm--danger { border-color: rgba(246,55,80,.4); color: #a11228; }
.btn-sm--danger:hover { background: #a11228; color: #fff; border-color: #a11228; }

.table-scroll { overflow-x: auto; }

.sidebar__badge {
  margin-left: auto;
  background: var(--color-coral);
  color: #fff;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .45rem;
  min-width: 1.2rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.inline-form {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .75rem;
}
.inline-form label { display: flex; flex-direction: column; gap: .3rem; flex: 1 1 12rem; }
.inline-form input, .inline-form select { min-width: 0; }

.legal-page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  color: #1D1D1B;
  background: #fff;
  line-height: 1.65;
}
.legal-page h1 { margin-bottom: .25rem; }
.legal-page h2 { margin-top: 2.25rem; font-size: 1.15rem; }
.legal-page .updated { color: rgba(29,29,27,.55); font-size: .85rem; margin-top: 0; }
.legal-page table { box-shadow: none; border: 1px solid rgba(29,29,27,.12); }
.legal-page a { color: var(--color-rose); }
.legal-page code {
  background: rgba(29,29,27,.06);
  padding: .1rem .35rem;
  border-radius: 4px;
  font-size: .9em;
}

/* Delivered-to-drafts reads as "action still needed", not as done. */
.status-DELIVERED { color: #8a4b0f; }
.status-PARTIAL { color: #8a4b0f; }
.status-NEEDS_ATTENTION { color: #a11228; }
.status-FAILED { color: #a11228; }
.status-PUBLISHING { color: var(--color-rose); }
