/* ===========================================================================
   CCE staff area.
   Shares the public brand tokens (defined in site.css) and the two fonts, but
   is laid out for density: tables, filters and statuses rather than marketing
   bands. Loaded after site.css, so it may safely override.
   =========================================================================== */

.abody {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------------ header */

.aheader {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 4px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 20;
}

.aheader__bar {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0.6rem clamp(0.9rem, 3vw, 2rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.aheader__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}
.aheader__brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #000;
}
.aheader__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
}
.aheader__sub {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 247, 239, 0.62);
}

.aheader__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.aheader__actions form {
  margin: 0;
}
.aheader__site {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
}
.aheader__who {
  font-size: 0.82rem;
  color: rgba(250, 247, 239, 0.75);
  padding-left: 0.75rem;
  border-left: 1px solid var(--rule-invert);
}

.anav {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 clamp(0.9rem, 3vw, 2rem) 0.5rem;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.anav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(250, 247, 239, 0.72);
  text-decoration: none;
  white-space: nowrap;
}
.anav__link:hover {
  color: var(--paper);
  background: rgba(250, 247, 239, 0.1);
}
.anav__link.is-active {
  background: var(--gold);
  color: var(--ink);
}
.anav__mark {
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.4rem;
}
.anav__link.is-active .anav__mark {
  background: var(--ink);
  color: var(--gold);
}

/* -------------------------------------------------------------------- main */

.amain {
  flex: 1;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(0.9rem, 3vw, 2rem) 3rem;
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.6rem);
  align-content: start;
}

.apage-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 2px solid var(--rule-strong);
  padding-bottom: 0.9rem;
}
.apage-title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  margin: 0;
  line-height: 1.05;
}
.apage-lede {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: var(--step-0);
  max-width: 60ch;
}
.apage-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.atabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.atabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--ink-3);
  background: var(--paper-3);
}
.atabs__tab.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.atabs__count {
  background: var(--gold);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.02rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ------------------------------------------------------------------- cards */

.acard {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.acard__head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(0.8rem, 2vw, 1.1rem) clamp(0.9rem, 2.2vw, 1.35rem);
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(242, 176, 30, 0.06), transparent);
}
.acard__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  margin: 0;
}
.acard__desc {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 70ch;
}
.acard__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.acard__body {
  padding: clamp(0.9rem, 2.2vw, 1.35rem);
}
.acard__body > *:first-child {
  margin-top: 0;
}
.acard__body > *:last-child {
  margin-bottom: 0;
}

.asplit {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.6rem);
  align-items: start;
}
@media (min-width: 1040px) {
  .asplit {
    grid-template-columns: 1.25fr 0.85fr;
  }
}
.asplit > div {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.6rem);
  align-content: start;
  min-width: 0;
}

/* ------------------------------------------------------------------- stats */

.astats {
  display: grid;
  gap: clamp(0.6rem, 1.6vw, 1rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}
.astat {
  display: grid;
  gap: 0.15rem;
  padding: 0.9rem 1rem;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--rule-strong);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}
.astat--gold {
  border-left-color: var(--gold);
}
.astat--green {
  border-left-color: var(--green);
}
.astat--red {
  border-left-color: var(--red);
}
.astat--link:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-soft);
}
.astat__value {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  line-height: 1;
}
.astat__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.astat__hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------ badges */

.abadge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--paper-2);
  color: var(--ink-3);
  white-space: nowrap;
}
.abadge--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}
.abadge--green {
  background: rgba(62, 142, 62, 0.14);
  border-color: var(--green);
  color: var(--green-deep);
}
.abadge--red {
  background: rgba(200, 38, 30, 0.12);
  border-color: var(--red);
  color: var(--red);
}
.abadge--muted {
  color: var(--muted);
  background: transparent;
}

/* ------------------------------------------------------------------ tables */

.atable-wrap {
  overflow-x: auto;
}
.atable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.atable caption {
  text-align: left;
  padding-bottom: 0.5rem;
  color: var(--muted);
}
.atable th,
.atable td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.atable thead th {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--rule-strong);
  white-space: nowrap;
}
.atable tbody th {
  font-weight: 600;
}
.atable tbody tr:hover {
  background: rgba(242, 176, 30, 0.06);
}

@media (max-width: 860px) {
  .atable thead {
    display: none;
  }
  .atable,
  .atable tbody,
  .atable tr,
  .atable th,
  .atable td {
    display: block;
    width: 100%;
  }
  .atable tr {
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.5rem;
    background: var(--paper-3);
  }
  .atable td::before,
  .atable tbody th::before {
    content: attr(data-label) ": ";
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
  }
}

.acell-person {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.acell-person__img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--ink-2);
  flex: none;
}
.acell-person__img--empty {
  display: inline-block;
  border: 1px dashed var(--rule-strong);
}

/* ------------------------------------------------------------------ forms */

.afield {
  margin: 0 0 0.9rem;
  display: grid;
  gap: 0.25rem;
}
.afield--wide {
  grid-column: 1 / -1;
}
.afield__label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.afield__req {
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
}
.afield__input {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  width: 100%;
  max-width: 100%;
}
.afield__input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--ink);
}
.afield__input--area {
  resize: vertical;
  min-height: 4.5rem;
  font-family: var(--font-body);
}
.afield__input--tiny {
  width: auto;
  padding: 0.3rem 0.4rem;
  font-size: 0.82rem;
}
.afield__hint {
  font-size: 0.8rem;
  color: var(--muted);
}
.afield--check label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-3);
}
.afield--inline {
  margin: 0;
  min-width: 11rem;
}

.agrid {
  display: grid;
  gap: 0.9rem;
}
.agrid--two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.afilters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.afilters .afield {
  margin: 0;
}

.astack {
  display: grid;
  gap: 0.4rem;
}
.ainline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.ainline form {
  margin: 0;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- buttons */

.abtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.1;
}
.abtn--gold {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.abtn--gold:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.abtn--ink {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.abtn--ink:hover {
  background: var(--ink-3);
}
.abtn--quiet {
  background: transparent;
  color: var(--ink-3);
  border-color: var(--rule-strong);
}
.abtn--quiet:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(242, 176, 30, 0.1);
}
.abtn--small {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
}
.abtn--block {
  width: 100%;
}
.abtn:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* ------------------------------------------------------- notices and lists */

.anotice {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  border-left: 5px solid var(--rule-strong);
  background: var(--paper-3);
  font-size: 0.92rem;
}
.anotice--info {
  border-left-color: var(--ink-3);
  background: var(--paper-2);
}
.anotice--success {
  border-left-color: var(--green);
  background: rgba(62, 142, 62, 0.1);
}
.anotice--error {
  border-left-color: var(--red);
  background: rgba(200, 38, 30, 0.09);
}

.aempty {
  margin: 0;
  padding: 0.9rem;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--paper);
}

.amuted {
  color: var(--muted);
  font-size: 0.84rem;
}

.alist,
.apills,
.aattention,
.aqueue,
.atimeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.alist > li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.alist > li:last-child {
  border-bottom: 0;
}
.alist p {
  margin: 0.15rem 0 0;
}

.apills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.apills li {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.78rem;
}

.aattention {
  display: grid;
  gap: 0.4rem;
}
.aattention li {
  padding: 0.55rem 0.75rem;
  border-left: 4px solid var(--gold);
  background: rgba(242, 176, 30, 0.1);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.aqueue li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.aqueue li:last-child {
  border-bottom: 0;
}
.aqueue__body {
  margin: 0.2rem 0 0;
  color: var(--ink-3);
  font-size: 0.9rem;
}

.atimeline li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.atimeline li:last-child {
  border-bottom: 0;
}
.atimeline__meta {
  font-size: 0.8rem;
  color: var(--muted);
}
.atimeline__body {
  margin: 0.25rem 0 0.35rem;
  font-size: 0.92rem;
}

.afacts {
  display: grid;
  grid-template-columns: minmax(7rem, auto) 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
  font-size: 0.92rem;
}
.afacts dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.15rem;
}
.afacts dd {
  margin: 0;
  min-width: 0;
}
@media (max-width: 620px) {
  .afacts {
    grid-template-columns: 1fr;
  }
  .afacts dd {
    margin-bottom: 0.4rem;
  }
}

.aquote {
  border-left: 4px solid var(--gold);
  padding-left: 0.75rem;
  color: var(--ink-3);
}

.acode {
  display: inline-block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  background: var(--ink);
  color: var(--gold);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  word-break: break-all;
}
.acode--path {
  max-width: 100%;
}

/* --------------------------------------------------------------- messages */

.athread {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.athread__item {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.75rem;
  background: var(--paper);
  max-width: 92%;
}
.athread__item--mine {
  background: rgba(242, 176, 30, 0.16);
  border-color: var(--gold);
  margin-left: auto;
}
.athread__item--system {
  background: var(--paper-2);
  border-style: dashed;
  max-width: 100%;
}
.athread__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.athread__who {
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.athread__flag {
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.athread__body {
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ----------------------------------------------------------------- footer */

.afooter {
  border-top: 1px solid var(--rule);
  padding: 1rem clamp(0.9rem, 3vw, 2rem) 2rem;
  max-width: 1500px;
  margin: 0 auto;
  width: 100%;
  color: var(--muted);
  font-size: 0.82rem;
}
.afooter p {
  margin: 0.2rem 0;
}

/* ------------------------------------------------------------ sign in page */

.abody--signin {
  display: grid;
  place-items: center;
  background: var(--ink);
  padding: 1.5rem;
}
.asignin {
  width: 100%;
  max-width: 420px;
}
.asignin__panel {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border-top: 6px solid var(--gold);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.asignin__logo {
  border-radius: 12px;
  background: #000;
  display: block;
  margin-bottom: 0.9rem;
}
.asignin__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  margin: 0 0 0.3rem;
}
.asignin__lede {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.asignin__form {
  margin-top: 0.5rem;
}
.asignin__note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.8rem 0 0;
}
.asignin__note a {
  color: var(--ink);
}

/* ----------------------------------------------------------------- upload */

#media-upload[data-busy="true"] button[type="submit"] {
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  .abtn--gold:hover {
    transform: none;
  }
}