/* MYTHCON admin panel. Colours come only from tokens.css (a synced copy of the website's tokens). */

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

.a-body,
.a-auth {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
code { font-family: var(--font-mono); font-size: 0.85em; background: var(--paper-dim); padding: 0.1em 0.4em; border-radius: 4px; }
button { font-family: inherit; }

.a-skip { position: absolute; left: -999px; top: 0; z-index: 200; background: var(--white); padding: 0.6rem 1rem; }
.a-skip:focus { left: 0.5rem; top: 0.5rem; }

.a-icon { width: 1.1em; height: 1.1em; flex: 0 0 auto; }

/* ---------- utilities ---------- */
.a-muted { color: var(--grey-500); }
.a-small { font-size: 0.82rem; }
.a-strong { font-weight: 600; color: var(--brand); }
.a-strong:hover { color: var(--navy-700); text-decoration: underline; }
.a-sub { display: block; font-size: 0.78rem; color: var(--grey-500); margin-top: 0.1rem; }
.a-right { text-align: right; }
.a-right-push { margin-left: auto; }
.a-nowrap { white-space: nowrap; }
.a-clip { max-width: 30rem; }
.a-link { color: var(--brand); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.a-hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.a-inline { display: inline-flex; gap: 0.25rem; align-items: center; margin: 0; }
.a-stack { display: grid; gap: 0.6rem; margin-top: 1rem; }
.a-empty { padding: 1.5rem; text-align: center; color: var(--grey-500); }
.a-empty .a-icon { color: var(--ok); vertical-align: -0.15em; }
.a-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }

/* ---------- shell ---------- */
.a-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }

.a-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.9rem;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--navy-950), var(--navy-900));
  color: var(--on-dark-ink);
}

.a-side__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem 1.1rem;
}

.a-side__brand img { background: var(--white); padding: 0.35rem 0.6rem; border-radius: 10px; height: 44px; width: auto; }

.a-nav { flex: 1; }
.a-nav__group { margin: 1.1rem 0.7rem 0.35rem; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-dark-muted); opacity: 0.8; }

.a-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--on-dark-muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.a-nav__link:hover { background: rgba(255, 255, 255, 0.07); color: var(--white); }
.a-nav__link.is-active { background: rgba(255, 255, 255, 0.12); color: var(--white); }
.a-nav__link.is-active::before { content: ''; position: absolute; left: -0.9rem; top: 20%; bottom: 20%; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.a-nav__link .a-badge { margin-left: auto; }
.a-side__foot { padding-top: 0.8rem; margin-top: 0.8rem; border-top: 1px solid var(--line-on-dark); }
.a-side__foot form { margin: 0; }

.a-scrim { display: none; }

.a-main { min-width: 0; display: flex; flex-direction: column; }

.a-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem clamp(1rem, 3vw, 2rem);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.a-top__menu { display: inline-grid; place-items: center; padding: 0.4rem; border: 0; background: none; color: var(--brand); cursor: pointer; }
.a-top__menu .a-icon { width: 1.5rem; height: 1.5rem; }
.a-crumbs { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--grey-500); min-width: 0; }
.a-crumbs a:hover { color: var(--brand); }
.a-crumbs__here { color: var(--ink); font-weight: 600; }

.a-content { width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2rem) 5rem; }

.a-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.a-head__title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 700; color: var(--brand-900); line-height: 1.15; }
.a-head__sub { margin-top: 0.3rem; color: var(--grey-500); }
.a-head__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- buttons ---------- */
.a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--brand);
  border-radius: 10px;
  background: var(--brand);
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
}

.a-btn:hover { background: var(--navy-700); border-color: var(--navy-700); transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(var(--navy-rgb), 0.7); }
.a-btn:active { transform: none; }
.a-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.a-btn--sm { padding: 0.42rem 0.8rem; font-size: 0.8rem; border-radius: 8px; }
.a-btn--block { width: 100%; }
.a-btn--ghost { background: var(--white); color: var(--brand); border-color: var(--line); }
.a-btn--ghost:hover { background: var(--paper-dim); color: var(--brand); border-color: var(--line); }
.a-btn--soft { background: rgba(var(--brand-rgb), 0.08); color: var(--brand); border-color: transparent; }
.a-btn--soft:hover { background: rgba(var(--brand-rgb), 0.15); color: var(--brand); border-color: transparent; }
.a-btn--danger { background: var(--danger); border-color: var(--danger); color: var(--white); }
.a-btn--danger:hover { background: var(--danger); border-color: var(--danger); filter: brightness(0.92); }

.a-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--grey-500);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.a-icon-btn:hover:not(:disabled) { background: var(--paper-dim); color: var(--brand); }
.a-icon-btn:disabled { opacity: 0.3; cursor: default; }

/* ---------- cards ---------- */
.a-card { margin-bottom: 1.25rem; padding: clamp(1.1rem, 2vw, 1.6rem); border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 1px 2px rgba(var(--navy-rgb), 0.04); }
.a-card--flush { padding: 0; overflow: hidden; }
.a-card--note { background: var(--paper-dim); border-color: transparent; }
.a-card__title { font-size: 1.05rem; font-weight: 600; color: var(--brand-900); margin-bottom: 0.4rem; }
.a-card__title--pad { padding: 1.1rem 1.4rem 0.2rem; }
.a-card__sub { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.a-card__row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.a-card__row .a-card__title { margin-bottom: 0.1rem; }
.a-anchor { scroll-margin-top: 5rem; }

.a-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.a-cols--wide { grid-template-columns: 1.4fr 1fr; }
.a-cols .a-card { margin-bottom: 0; }
.a-cols + .a-cols, .a-tiles + .a-cols { margin-top: 1.25rem; }

/* ---------- badges, alerts ---------- */
.a-badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--paper-dim); color: var(--grey-600); font-size: 0.72rem; font-weight: 600; font-style: normal; white-space: nowrap; }
.a-badge--ok { background: var(--ok-tint); color: var(--ok); }
.a-badge--warn { background: var(--gold-tint); color: var(--gold-600); }
.a-badge--alert { background: var(--danger); color: var(--white); }
.a-badge--brand { background: rgba(var(--brand-rgb), 0.1); color: var(--brand); }

.a-alert { display: flex; align-items: flex-start; gap: 0.7rem; margin-bottom: 1rem; padding: 0.8rem 1rem; border-radius: 12px; background: var(--paper-dim); color: var(--ink); font-size: 0.9rem; }
.a-alert .a-icon { margin-top: 0.2em; }
.a-alert span, .a-alert div { flex: 1; }
.a-alert button { border: 0; background: none; color: inherit; cursor: pointer; opacity: 0.6; padding: 0; }
.a-alert button:hover { opacity: 1; }
.a-alert--success { background: var(--ok-tint); color: var(--ok); }
.a-alert--danger { background: var(--danger-tint); color: var(--danger); }
.a-alert--warning { background: var(--gold-tint); color: var(--gold-600); }
.a-alert--big { padding: 1.1rem 1.25rem; }
.a-secret { display: inline-block; margin: 0.4rem 0.6rem 0.4rem 0; padding: 0.4rem 0.8rem; background: var(--white); color: var(--ink); font-size: 1.1rem; letter-spacing: 0.06em; border-radius: 8px; }

/* ---------- forms ---------- */
.a-form { display: block; }
.a-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.25rem; }
.a-field { min-width: 0; position: relative; }
.a-field--wide, .a-field--textarea { grid-column: 1 / -1; }
.a-field--grow { flex: 1; }
.a-field--narrow { width: 6rem; }
.a-field--toggle { grid-column: 1 / -1; }
.a-label { display: block; margin-bottom: 0.35rem; font-size: 0.82rem; font-weight: 600; color: var(--grey-600); }
.a-req { color: var(--danger); }

.a-input {
  width: 100%;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.a-input:hover { border-color: var(--grey-300); }
.a-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.14); }
.a-input--auto { width: auto; }
.a-input--mono { font-family: var(--font-mono); font-size: 0.85rem; }
textarea.a-input { resize: vertical; min-height: 4.5rem; }
.a-field.has-error .a-input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(var(--danger-rgb), 0.12); }
.a-help { margin-top: 0.35rem; font-size: 0.78rem; color: var(--grey-500); }
.a-error { margin-top: 0.35rem; font-size: 0.8rem; font-weight: 500; color: var(--danger); }
.a-count { position: absolute; right: 0.6rem; bottom: 0.35rem; font-size: 0.68rem; color: var(--grey-300); pointer-events: none; }
.a-field--textarea .a-count, .a-field--text .a-count { bottom: auto; top: 0.1rem; right: 0; }

.a-toggle { display: inline-flex; align-items: center; gap: 0.7rem; cursor: pointer; font-weight: 500; }
.a-toggle input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.a-toggle__track { position: relative; width: 2.6rem; height: 1.5rem; border-radius: 999px; background: var(--grey-300); transition: background var(--duration-fast); flex: 0 0 auto; }
.a-toggle__track::after { content: ''; position: absolute; left: 0.2rem; top: 0.2rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(var(--navy-rgb), 0.3); transition: transform var(--duration-base) var(--ease-out); }
.a-toggle input:checked + .a-toggle__track { background: var(--ok); }
.a-toggle input:checked + .a-toggle__track::after { transform: translateX(1.1rem); }
.a-toggle input:focus-visible + .a-toggle__track { box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.25); }

.a-options { display: grid; grid-template-columns: minmax(0, 20rem); margin-bottom: 0.5rem; }

/* tabs */
.a-tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.a-tabs::-webkit-scrollbar { display: none; }
.a-tabs__btn { position: relative; flex: 0 0 auto; padding: 0.6rem 1.1rem; border: 0; border-radius: 10px; background: none; color: var(--grey-500); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: background var(--duration-fast), color var(--duration-fast); }
.a-tabs__btn:hover { background: rgba(var(--brand-rgb), 0.06); color: var(--brand); }
.a-tabs__btn.is-active { background: var(--white); color: var(--brand); box-shadow: 0 1px 3px rgba(var(--navy-rgb), 0.12); }
.a-tabs__btn.has-error::after { content: ''; position: absolute; top: 0.45rem; right: 0.45rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--danger); }
.a-form--tabs .a-panel { display: none; }
.a-form--tabs .a-panel.is-active { display: block; animation: a-rise 0.35s var(--ease-out); }

@keyframes a-rise { from { opacity: 0; transform: translateY(8px); } }

.a-savebar { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; gap: 0.6rem; margin: 1.25rem -0.5rem 0; padding: 0.9rem 0.5rem; background: linear-gradient(0deg, var(--paper) 65%, transparent); }

.a-jump { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.a-jump a { padding: 0.35rem 0.85rem; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: 0.8rem; font-weight: 500; color: var(--grey-600); transition: all var(--duration-fast); }
.a-jump a:hover { border-color: var(--brand); color: var(--brand); }

.a-catrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; padding: 0.9rem 0; border-top: 1px solid var(--line); }
.a-catrow .a-field { margin: 0; }
.a-catrow .a-field--grow { min-width: 14rem; }

/* ---------- repeater + picker ---------- */
.a-repeater { display: grid; gap: 0.75rem; }
.a-repeater__rows { display: grid; gap: 0.75rem; }
.a-row { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; animation: a-rise 0.3s var(--ease-out); }
.a-row__bar { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0.5rem 0.4rem 0.9rem; background: var(--paper-dim); }
.a-row__title { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grey-600); }
.a-row__title b { color: var(--brand); }
.a-row__btns { display: flex; gap: 0.15rem; }
.a-row__btns button, .a-picker__btns button { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--grey-500); cursor: pointer; }
.a-row__btns button:hover, .a-picker__btns button:hover { background: var(--white); color: var(--brand); }
.a-row__btns [data-remove]:hover, .a-picker__btns [data-remove]:hover { color: var(--danger); }
.a-row__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1rem; padding: 1rem; }
.a-row__fields .a-field--wide, .a-row__fields .a-field--textarea { grid-column: 1 / -1; }
.a-repeater > [data-add] { justify-self: start; }

.a-picker { display: grid; gap: 0.6rem; }
.a-picker__list { display: grid; gap: 0.4rem; }
.a-picker__item { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.35rem 0.4rem 0.35rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--white); animation: a-rise 0.25s var(--ease-out); }
.a-picker__title { font-size: 0.88rem; font-weight: 500; }
.a-picker__btns { display: flex; }

/* ---------- media field ---------- */
.a-media { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1rem; padding: 0.8rem; border: 1px dashed var(--grey-300); border-radius: 14px; background: var(--paper); transition: border-color var(--duration-fast), background var(--duration-fast); }
.a-media.is-over { border-color: var(--gold); background: var(--gold-tint); }
.a-media__preview { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 10px; background: var(--paper-dim); }
.a-media__preview img { width: 100%; height: 100%; object-fit: cover; animation: a-rise 0.4s var(--ease-out); }
.a-media__empty { display: grid; justify-items: center; gap: 0.3rem; padding: 0.5rem; text-align: center; color: var(--grey-500); font-size: 0.78rem; }
.a-media__empty .a-icon { width: 1.8rem; height: 1.8rem; }
.a-media__empty em { font-style: normal; word-break: break-all; }
.a-media__body { display: flex; flex-direction: column; justify-content: center; gap: 0.6rem; min-width: 0; }
.a-media__status { font-size: 0.84rem; color: var(--grey-600); }
.a-media__status.is-error { color: var(--danger); }
.a-media__status.is-ok { color: var(--ok); font-weight: 500; }
.a-media__progress { height: 6px; border-radius: 999px; background: var(--paper-dim); overflow: hidden; }
.a-media__progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--gold)); transition: width 150ms linear; }
.a-media__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.a-media__note { margin: 0; }

.a-thumb { display: block; width: 96px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--paper-dim); }
.a-thumb--empty { display: grid; place-items: center; color: var(--grey-300); }
.a-col-thumb { width: 116px; }
.a-col-check { width: 2.5rem; }

/* ---------- tables ---------- */
.a-table-wrap { overflow-x: auto; }
.a-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.a-table th { padding: 0.75rem 1rem; text-align: left; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey-500); background: var(--paper); border-bottom: 1px solid var(--line); }
.a-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.a-table tbody tr { transition: background var(--duration-fast); }
.a-table tbody tr:hover { background: rgba(var(--brand-rgb), 0.03); }
.a-table tbody tr:last-child td { border-bottom: 0; }
.a-table th.a-right { text-align: right; }
.a-table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.a-table tr.is-new .a-strong { font-weight: 700; }

/* ---------- toolbar, chips, search, pager ---------- */
.a-toolbar, .a-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.a-search { display: flex; align-items: center; gap: 0.5rem; min-width: 16rem; padding: 0.15rem 0.85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--grey-500); }
.a-search input { flex: 1; border: 0; outline: 0; padding: 0.5rem 0; background: none; font: inherit; font-size: 0.9rem; color: var(--ink); }
.a-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12); }
.a-search--inline { margin-left: auto; margin-bottom: 0; }
.a-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: 0.82rem; font-weight: 500; color: var(--grey-600); transition: all var(--duration-fast); }
.a-chip em { font-style: normal; font-size: 0.72rem; color: var(--grey-500); }
.a-chip:hover { border-color: var(--brand); color: var(--brand); }
.a-chip.is-active { background: var(--brand); border-color: var(--brand); color: var(--white); }
.a-chip.is-active em { color: var(--on-dark-muted); }
.a-chip--sm { padding: 0.15rem 0.6rem; font-size: 0.72rem; }
.a-pager { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: center; margin-top: 1rem; }
.a-pager__link { display: grid; place-items: center; min-width: 2.2rem; height: 2.2rem; padding: 0 0.5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: 0.85rem; }
.a-pager__link.is-active { background: var(--brand); border-color: var(--brand); color: var(--white); }
.a-bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem; background: var(--gold-tint); border-bottom: 1px solid var(--line); }

/* ---------- dashboard ---------- */
.a-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.a-tile { position: relative; display: grid; gap: 0.15rem; padding: 1.15rem 1.25rem; border: 1px solid var(--line); border-radius: 16px; background: var(--white); transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out); overflow: hidden; }
.a-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.a-tile b { font-size: 2rem; line-height: 1.1; color: var(--brand); }
.a-tile span:not(.a-tile__icon) { font-size: 0.82rem; color: var(--grey-500); }
.a-tile__icon { position: absolute; right: 1rem; top: 1rem; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: rgba(var(--brand-rgb), 0.08); color: var(--brand); }
.a-tile--alert { border-color: var(--gold); background: linear-gradient(135deg, var(--white), var(--gold-tint)); }
.a-tile--alert b { color: var(--gold-600); }
.a-todo { display: grid; gap: 0.4rem; }
.a-todo a { display: flex; align-items: center; gap: 0.7rem; padding: 0.65rem 0.8rem; border-radius: 10px; background: var(--paper); font-size: 0.88rem; transition: background var(--duration-fast); }
.a-todo a:hover { background: var(--paper-dim); }
.a-todo a > .a-icon:first-child { color: var(--gold-600); }
.a-todo a > span { flex: 1; }
.a-todo a > .a-icon:last-child { color: var(--grey-300); }
.a-quick { display: grid; gap: 0.6rem; }
.a-quick .a-btn { justify-content: flex-start; }
.a-msg { display: grid; gap: 0.15rem; padding: 0.7rem 0.4rem; border-top: 1px solid var(--line); }
.a-msg:hover { background: var(--paper); }
.a-msg__top { display: flex; justify-content: space-between; gap: 0.5rem; }
.a-msg__top em { font-style: normal; font-size: 0.75rem; color: var(--grey-500); }
.a-msg__text { font-size: 0.85rem; color: var(--grey-500); }
.a-msg.is-new .a-msg__top strong::before { content: ''; display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.45rem; border-radius: 50%; background: var(--gold); }
.a-feed { display: grid; gap: 0.8rem; }
.a-feed li { display: flex; gap: 0.7rem; font-size: 0.87rem; }
.a-feed em { display: block; font-style: normal; font-size: 0.75rem; color: var(--grey-500); }
.a-feed__dot { flex: 0 0 auto; width: 0.6rem; height: 0.6rem; margin-top: 0.4rem; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.12); }

.a-message { position: relative; padding: 1rem 1.1rem; border-radius: 12px; background: var(--paper); font-size: 0.98rem; line-height: 1.7; overflow-wrap: anywhere; }
.a-dl { display: grid; gap: 0.7rem; margin-bottom: 0.5rem; }
.a-dl div { display: grid; gap: 0.05rem; }
.a-dl dt { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey-500); }
.a-dl dd { font-weight: 500; word-break: break-word; }

/* ---------- media library ---------- */
.a-drop { display: grid; justify-items: center; gap: 0.3rem; padding: 2rem 1rem; border: 2px dashed var(--grey-300); border-radius: 16px; text-align: center; color: var(--grey-600); cursor: pointer; transition: border-color var(--duration-fast), background var(--duration-fast); }
.a-drop:hover, .a-drop.is-over { border-color: var(--gold); background: var(--gold-tint); }
.a-drop .a-icon { width: 1.8rem; height: 1.8rem; color: var(--brand); }
.a-drop em { font-style: normal; font-size: 0.78rem; color: var(--grey-500); }
.a-uplist { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.a-uplist li { display: grid; gap: 0.3rem; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; font-size: 0.85rem; }
.a-mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.a-mcard { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--white); transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out); }
.a-mcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.a-mcard__thumb { aspect-ratio: 3 / 2; background: var(--paper-dim); overflow: hidden; }
.a-mcard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-mcard__doc { display: grid; place-content: center; justify-items: center; height: 100%; color: var(--brand); }
.a-mcard__doc .a-icon { width: 2.4rem; height: 2.4rem; }
.a-mcard__doc em { font-style: normal; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; }
.a-mcard__body { display: grid; gap: 0.35rem; padding: 0.8rem; }
.a-mcard__name { font-weight: 600; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-mcard__uses { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.a-mcard__actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.25rem; }

/* ---------- modal + toasts ---------- */
.a-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgba(var(--navy-rgb), 0.55); backdrop-filter: blur(3px); }
.a-modal[hidden] { display: none; }
.a-modal__box { width: min(26rem, 100%); padding: 1.5rem; border-radius: 18px; background: var(--white); box-shadow: 0 30px 60px -20px rgba(var(--navy-rgb), 0.6); animation: a-rise 0.3s var(--ease-out); }
.a-modal__box h2 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.a-modal__box p { color: var(--grey-500); }
.a-modal__actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; }

/* ---------- sign-in ---------- */
.a-auth { display: grid; place-items: center; min-height: 100vh; padding: 1.25rem; background: radial-gradient(circle at 15% 10%, rgba(var(--brand-rgb), 0.16), transparent 40%), linear-gradient(180deg, var(--hero-a), var(--hero-b)); }
.a-auth__card { width: min(26rem, 100%); padding: 2rem; border-radius: 20px; background: var(--white); box-shadow: var(--shadow-card); animation: a-rise 0.5s var(--ease-out); }
.a-auth__card h1 { font-size: 1.5rem; color: var(--brand-900); margin-bottom: 0.3rem; }
.a-auth__card .a-form { margin: 1.25rem 0 0.75rem; display: grid; gap: 1rem; }
.a-auth__card .a-muted { margin-bottom: 0.5rem; }
.a-auth__logo { display: block; margin: 0 auto 1.25rem; width: auto; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .a-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-cols, .a-cols--wide { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .a-shell { grid-template-columns: 1fr; }
  .a-side { position: fixed; z-index: 90; left: 0; top: 0; width: 17rem; transform: translateX(-100%); transition: transform var(--duration-base) var(--ease-out); }
  .a-side.is-open { transform: none; }
  .a-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(var(--navy-rgb), 0.5); }
  .a-scrim.is-open { display: block; }
}

@media (max-width: 640px) {
  .a-grid, .a-row__fields { grid-template-columns: 1fr; }
  .a-media { grid-template-columns: 1fr; }
  .a-tiles { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .a-tile b { font-size: 1.6rem; }
  .a-search { min-width: 0; width: 100%; }
  .a-search--inline { margin-left: 0; }
  .a-top .a-btn { display: none; }
  .a-head__actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

[hidden] { display: none !important; }

/* ---------- compact rows (client logos) ---------- */
.a-repeater--compact .a-repeater__rows { gap: 0.4rem; }
.a-row--compact { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.4rem 0.4rem 0.6rem; overflow: visible; }
.a-row--compact .a-row__fields { flex: 1; display: grid; grid-template-columns: 6.5rem minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 0.6rem; padding: 0; }
.a-row--compact .a-label, .a-row--compact .a-help, .a-row--compact .a-count { display: none; }
.a-row--compact .a-input { padding: 0.5rem 0.7rem; }
.a-row--compact .a-error { position: absolute; left: 0; top: 100%; z-index: 2; margin: 0; }
.a-media--compact { grid-template-columns: 1fr; gap: 0.3rem; padding: 0; border: 0; background: none; }
.a-media--compact .a-media__preview { aspect-ratio: 2 / 1; border-radius: 8px; background: var(--white); border: 1px solid var(--line); }
.a-media--compact .a-media__preview img { object-fit: contain; }
.a-media--compact .a-media__empty em { display: none; }
.a-media--compact .a-media__body { gap: 0.25rem; }
.a-media--compact .a-media__status:not(.is-ok):not(.is-error), .a-media--compact [data-media-remove] { display: none; }
.a-media--compact .a-media__status { font-size: 0.7rem; }
.a-media--compact .a-media__actions { gap: 0; }
.a-media--compact .a-btn { width: 100%; padding: 0.25rem 0.5rem; font-size: 0.72rem; }
.a-media--compact .a-btn .a-icon { display: none; }

@media (max-width: 640px) {
  .a-row--compact { flex-wrap: wrap; }
  .a-row--compact .a-row__fields { grid-template-columns: 6rem minmax(0, 1fr); }
  .a-row--compact .a-row__fields .a-field:nth-child(3) { grid-column: 1 / -1; }
}
.a-row--compact .a-row__fields .a-field { grid-column: auto; }
.a-row--compact .a-field--image { max-width: 6.5rem; }

/* ---------- drag to reorder ---------- */
.a-drag { display: grid; place-items: center; flex: 0 0 auto; width: 1.9rem; height: 1.9rem; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--grey-300); cursor: grab; touch-action: none; transition: background var(--duration-fast), color var(--duration-fast); }
.a-drag .a-icon { stroke-width: 3.2; }
.a-drag:hover, .a-drag:focus-visible { background: var(--paper-dim); color: var(--brand); outline: none; }
.a-drag:active { cursor: grabbing; }
.a-row__lead { display: flex; align-items: center; gap: 0.25rem; }
.a-row__bar { padding-left: 0.4rem; }
.a-row--compact { padding-left: 0.2rem; }
.a-picker__item { padding-left: 0.3rem; }
.a-picker__title { flex: 1; }
.a-col-drag { width: 2.5rem; padding-right: 0 !important; }

.is-sorting { user-select: none; -webkit-user-select: none; }
.is-sorting .a-drag { cursor: grabbing; }
.is-dragging { position: relative; z-index: 40; background: var(--white) !important; box-shadow: 0 18px 36px -14px rgba(var(--navy-rgb), 0.45), 0 0 0 2px var(--gold) !important; border-radius: 12px; animation: none !important; }
tr.is-dragging { display: table-row; }
tr.is-dragging td { background: var(--white); }

/* ---------- universal loader ---------- */
.a-loader { position: fixed; top: 0; left: 0; right: 0; z-index: 300; height: 3px; pointer-events: none; }
.a-loader span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--gold)); box-shadow: 0 0 10px rgba(var(--brand-rgb), 0.45); }
.a-loader.is-running span { animation: a-load 9s cubic-bezier(0.1, 0.6, 0.2, 1) forwards; }
.a-loader.is-done span { width: 100%; opacity: 0; transition: width 0.2s ease-out, opacity 0.35s 0.2s; }
@keyframes a-load { 0% { width: 0; } 20% { width: 38%; } 55% { width: 72%; } 100% { width: 93%; } }

.a-busy { position: fixed; inset: 0; z-index: 290; display: grid; place-content: center; justify-items: center; gap: 0.9rem; background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(3px); animation: a-fade 0.2s ease-out; }
.a-busy[hidden] { display: none; }
.a-busy p { font-weight: 600; color: var(--brand); }
.a-spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(var(--brand-rgb), 0.14); border-top-color: var(--gold); border-right-color: var(--brand); animation: a-spin 0.8s linear infinite; }
@keyframes a-spin { to { transform: rotate(360deg); } }
@keyframes a-fade { from { opacity: 0; } }

.a-content { animation: a-rise 0.4s var(--ease-out); }

/* confirmation dialog: short and phone-friendly */
.a-modal__box { width: min(22rem, 100%); padding: 1.25rem 1.25rem 1.1rem; }
.a-modal__box h2 { font-size: 1.05rem; }
.a-modal__box p { font-size: 0.9rem; }
.a-modal__actions .a-btn { flex: 1; }
@media (max-width: 480px) {
  .a-modal { align-items: end; padding: 0; }
  .a-modal__box { width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(1.1rem + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .a-spinner { animation: a-spin 1.6s linear infinite !important; }
}

/* ---------- floating notifications (top-right, never block the page) ---------- */
.a-toasts { position: fixed; top: 4.2rem; right: 0.9rem; z-index: 320; display: grid; gap: 0.6rem; width: min(23rem, calc(100vw - 1.8rem)); pointer-events: none; }
.a-toast { --tone: var(--brand); position: relative; display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.85rem 0.6rem 0.95rem 0.9rem; overflow: hidden; border-radius: 14px; background: var(--white); color: var(--ink); font-size: 0.9rem; line-height: 1.45; box-shadow: 0 18px 40px -16px rgba(var(--navy-rgb), 0.5), 0 0 0 1px var(--line); pointer-events: auto; animation: a-toast-in 0.5s var(--ease-out) both; }
.a-toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone); }
.a-toast--success { --tone: var(--ok); }
.a-toast--danger { --tone: var(--danger); }
.a-toast--warning { --tone: var(--gold-600); }
.a-toast__icon { width: 1.25rem; height: 1.25rem; margin-top: 0.05rem; color: var(--tone); }
.a-toast__text { flex: 1; min-width: 0; word-break: break-word; }
.a-toast__close { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--grey-500); cursor: pointer; }
.a-toast__close:hover { background: var(--paper-dim); color: var(--ink); }
.a-toast__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tone); opacity: 0.55; transform-origin: left; animation: a-toast-bar var(--ttl, 5500ms) linear forwards; }
.a-toast:hover .a-toast__bar { animation-play-state: paused; }
.a-toast.is-leaving { animation: a-toast-out 0.3s ease-in forwards; }
@keyframes a-toast-in { from { opacity: 0; transform: translateX(28px) scale(0.96); } }
@keyframes a-toast-out { to { opacity: 0; transform: translateX(28px) scale(0.96); } }
@keyframes a-toast-bar { to { transform: scaleX(0); } }

/* busy shield: blocks every click while something is working; the spinner appears only if it takes a moment */
.a-busy.is-quiet { background: transparent; backdrop-filter: none; animation: none; }
.a-busy.is-quiet > * { opacity: 0; }
.a-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.a-btn.is-loading .a-icon { opacity: 0; }
.a-btn.is-loading::after { content: ''; position: absolute; left: 50%; top: 50%; width: 1.1rem; height: 1.1rem; margin: -0.55rem 0 0 -0.55rem; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: var(--white); animation: a-spin 0.7s linear infinite; }
.a-btn--ghost.is-loading::after, .a-btn--soft.is-loading::after { border-color: rgba(var(--brand-rgb), 0.2); border-top-color: var(--brand); }
@media (prefers-reduced-motion: reduce) { .a-btn.is-loading::after { animation: a-spin 1.6s linear infinite !important; } }
/* ---------- messages ---------- */
.a-stackcol { display: grid; gap: 1.25rem; align-content: start; min-width: 0; }
.a-stackcol > .a-card { margin-bottom: 0; }
.a-message.is-long { max-height: 15rem; overflow: hidden; transition: max-height 0.4s var(--ease-out); }
.a-message.is-long::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4.5rem; border-radius: 0 0 12px 12px; background: linear-gradient(180deg, transparent, var(--paper)); pointer-events: none; transition: opacity 0.2s; }
.a-message.is-long.is-open { max-height: 200rem; }
.a-message.is-long.is-open::after { opacity: 0; }
.a-expand { margin-top: 0.75rem; }
.a-expand .a-icon { transition: transform var(--duration-base) var(--ease-out); }
.a-expand.is-open .a-icon { transform: rotate(180deg); }
.a-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.a-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.a-pn__link { display: grid; gap: 0.1rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--white); font-weight: 600; color: var(--brand); transition: border-color var(--duration-fast), transform var(--duration-base) var(--ease-out); }
.a-pn__link small { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey-500); }
.a-pn__link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.a-pn__link:hover { border-color: var(--brand); transform: translateY(-2px); }
.a-pn__link.is-off { opacity: 0.45; }

/* ---------- message dialog ---------- */
.a-mdialog { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 1.25rem; background: rgba(var(--navy-rgb), 0.55); backdrop-filter: blur(3px); animation: a-fade 0.2s ease-out; }
.a-mdialog[hidden] { display: none; }
.a-mdialog__panel { display: flex; flex-direction: column; width: min(46rem, 100%); max-height: calc(100vh - 2.5rem); overflow: hidden; border-radius: 20px; background: var(--white); box-shadow: 0 30px 70px -24px rgba(var(--navy-rgb), 0.65); animation: a-rise 0.35s var(--ease-out); }
.a-mdetail { display: flex; flex-direction: column; min-height: 0; }
.a-mhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem 0.9rem; border-bottom: 1px solid var(--line); }
.a-mhead__who { min-width: 0; }
.a-mhead__who h2 { font-size: 1.15rem; color: var(--brand-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-mhead__tools { display: flex; align-items: center; gap: 0.15rem; flex: 0 0 auto; }
.a-mhead__close { margin-left: 0.3rem; }
.a-mbody { flex: 1; min-height: 0; overflow-y: auto; padding: 1.1rem 1.25rem; display: grid; gap: 1rem; align-content: start; }
.a-mrow { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: -0.4rem; }
.a-dl--grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.8rem 1.25rem; margin: 0; padding: 0.9rem 1rem; border-radius: 12px; background: var(--paper); }
.a-mnote { display: grid; gap: 0.5rem; justify-items: start; }
.a-mnote .a-input { width: 100%; }
.a-mfoot { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.9rem 1.25rem; border-top: 1px solid var(--line); background: var(--paper); }
.a-mfoot__del { margin-left: auto; }
.a-mloading { display: grid; place-items: center; min-height: 14rem; }
tr.is-leaving { opacity: 0; transition: opacity 0.25s; }
@media (max-width: 640px) {
  .a-mdialog { align-items: end; padding: 0; }
  .a-mdialog__panel { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .a-mfoot { padding-bottom: calc(0.9rem + env(safe-area-inset-bottom)); }
  .a-mfoot .a-btn { flex: 1 1 auto; }
  .a-mfoot__del { margin-left: 0; }
}

.a-mfoot__del { width: 2.4rem; height: 2.4rem; padding: 0; }

/* ---------- photos & files: compact ---------- */
.a-uploadbar { display: flex; gap: 0.6rem; margin-bottom: 0.9rem; }
.a-drop--slim { flex: 1; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.7rem 1rem; border-width: 1.5px; border-radius: 12px; font-size: 0.88rem; }
.a-drop--slim .a-icon { width: 1.1rem; height: 1.1rem; }
.a-mediagrid--compact { grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 0.75rem; }
.a-mediagrid--compact .a-mcard { border-radius: 12px; }
.a-mediagrid--compact .a-mcard__thumb { position: relative; aspect-ratio: 4 / 3; background: var(--white); border-bottom: 1px solid var(--line); }
.a-mediagrid--compact .a-mcard__thumb img { object-fit: contain; }
.a-mediagrid--compact .a-mcard__body { gap: 0.1rem; padding: 0.55rem 0.65rem 0.4rem; }
.a-mediagrid--compact .a-mcard__name { font-size: 0.8rem; }
.a-mediagrid--compact .a-sub { margin: 0; font-size: 0.72rem; }
.a-mcard__flag { position: absolute; left: 0.4rem; top: 0.4rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--gold-tint); color: var(--gold-600); font-size: 0.65rem; font-weight: 600; }
.a-mcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.3rem; margin-top: 0.15rem; min-height: 2rem; }
.a-mcard__uses { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.a-mcard__actions { display: flex; align-items: center; flex: 0 0 auto; }
.a-mcard__actions .a-icon-btn { width: 1.8rem; height: 1.8rem; }
.a-icon-btn--danger:hover:not(:disabled) { background: var(--danger-tint); color: var(--danger); }
.a-uplist:empty { display: none; }
.a-mcard__uses .a-chip { display: inline-block; max-width: 6.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- activity log ---------- */
.a-toolbar--tight { gap: 0.5rem; margin-bottom: 0.9rem; }
.a-filters--inline { margin: 0; gap: 0.35rem; }
.a-log { margin-bottom: 0.75rem; }
.a-log__day { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 1.1rem; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey-600); }
.a-log__day:first-child { border-top: 0; }
.a-log__day span { padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-weight: 600; letter-spacing: 0; }
.a-log__list { margin: 0; }
.a-log__row { display: grid; grid-template-columns: 4.6rem 2rem minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.55rem 1.1rem; border-bottom: 1px solid var(--line); font-size: 0.86rem; transition: background var(--duration-fast); }
.a-log__row:last-child { border-bottom: 0; }
.a-log__row:hover { background: rgba(var(--brand-rgb), 0.03); }
.a-log__time { font-variant-numeric: tabular-nums; font-size: 0.78rem; color: var(--grey-500); white-space: nowrap; }
.a-avatar { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgba(var(--brand-rgb), 0.1); color: var(--brand); font-size: 0.7rem; font-weight: 700; }
.a-log__body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.5rem; min-width: 0; }
.a-log__who { font-weight: 600; color: var(--ink); }
.a-log__what { color: var(--grey-600); overflow-wrap: anywhere; }
a.a-log__what { color: var(--brand); }
a.a-log__what:hover { text-decoration: underline; }
.a-log__meta { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; white-space: nowrap; }
.a-log__entity { font-size: 0.72rem; color: var(--grey-500); }
.a-log__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.a-pager--inline { margin: 0; }
@media (max-width: 720px) {
  .a-log__row { grid-template-columns: 2rem minmax(0, 1fr); row-gap: 0.15rem; padding: 0.65rem 0.9rem; }
  .a-log__time { grid-column: 2; grid-row: 1; }
  .a-avatar { grid-row: 1 / span 3; align-self: start; }
  .a-log__body { grid-column: 2; }
  .a-log__meta { grid-column: 2; justify-content: flex-start; }
}

.a-pager__gap { display: grid; place-items: center; min-width: 1.4rem; color: var(--grey-500); }
.a-log__foot .a-pager { gap: 0.4rem; }

/* ---------- form dialogs + roles ---------- */
.a-mdialog__panel--sm { width: min(30rem, 100%); }
.a-mdialog__panel--sm .a-mbody { gap: 1rem; }
.a-mdialog__panel--sm [data-xm-form], .a-mdialog__panel--sm [data-xm-done] { display: flex; flex-direction: column; min-height: 0; }
.a-mdialog__panel--sm form { display: flex; flex-direction: column; min-height: 0; }
.a-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem 1.5rem; margin: 0.4rem 0 0; }
.a-roles dt { font-weight: 600; color: var(--brand); }
.a-roles dd { margin: 0.1rem 0 0; font-size: 0.85rem; color: var(--grey-600); }

.a-passbox { display: grid; gap: 0.4rem; padding: 0.9rem 1rem; border-radius: 12px; background: var(--ok-tint); }
.a-passbox__label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok); }
.a-passbox__row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.a-passbox .a-secret { margin: 0; }
.a-mfoot__sp { flex: 1; }
.a-mfoot .a-mfoot__del { margin-left: 0; }
.a-card__title--icon { display: flex; align-items: center; gap: 0.45rem; }
.a-card__title--icon .a-icon { color: var(--brand); flex: none; }

/* ---------- collapsible sidebar (desktop icon rail; mobile uses the drawer) ---------- */
.a-shell { transition: grid-template-columns var(--duration-base) var(--ease-out); }
@media (min-width: 861px) {
  .a-collapsed .a-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .a-collapsed .a-side { padding-inline: 0.6rem; overflow-x: hidden; }
  .a-collapsed .a-side__brand { justify-content: center; padding-inline: 0; }
  .a-collapsed .a-side__brand img { width: 44px; height: 44px; padding: 0.3rem; object-fit: cover; object-position: left center; }
  .a-collapsed .a-nav__group { height: 1px; margin: 0.8rem 0.6rem; padding: 0; overflow: hidden; font-size: 0; background: var(--line-on-dark); }
  .a-collapsed .a-nav__link { justify-content: center; padding-inline: 0; }
  .a-collapsed .a-nav__link > span { display: none; }
  .a-collapsed .a-nav__link .a-badge { position: absolute; top: 2px; right: 4px; margin: 0; transform: scale(0.85); }
  .a-collapsed .a-nav__link.is-active::before { left: -0.6rem; }
}
@media (max-width: 860px) {
  .a-side { max-width: 86vw; }
}.a-input[readonly] { background: var(--paper-dim); color: var(--muted, inherit); cursor: default; }

/* ---------- settings: collapsible blocks, info notes, inline field rows ---------- */
.a-fold { padding: 0; margin-bottom: 0.7rem; }
.a-fold__head { display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 1.1rem; cursor: pointer; list-style: none; }
.a-fold__head::-webkit-details-marker { display: none; }
.a-fold__text { flex: 1; min-width: 0; display: grid; }
.a-fold__text strong { font-size: 1rem; font-weight: 600; color: var(--brand-900); }
.a-fold__text small { color: var(--grey-600); font-size: 0.82rem; }
.a-fold__chev { display: grid; place-items: center; color: var(--grey-600); transition: transform var(--duration-fast); }
.a-fold[open] .a-fold__chev { transform: rotate(180deg); }
.a-fold[open] > .a-fold__head { border-bottom: 1px solid var(--line); }
.a-fold__body { padding: 1.1rem; }
.a-info { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.6rem 0.85rem; border-radius: 10px; background: var(--paper-dim); color: var(--grey-600); font-size: 0.85rem; }
.a-info .a-icon { color: var(--grey-600); flex: none; }
.a-info__link { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 600; color: var(--brand); }
.a-info__link .a-icon { width: 0.9em; height: 0.9em; color: inherit; }
.a-grid--tri { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.a-grid--tri > .a-field { grid-column: span 3; }
.a-grid--tri > .a-field--wide, .a-grid--tri > .a-field--textarea, .a-grid--tri > .a-info { grid-column: 1 / -1; }
.a-grid--tri > .a-field--third { grid-column: span 2; }
.a-field[hidden] { display: none; }
@media (max-width: 640px) {
  .a-grid--tri > .a-field, .a-grid--tri > .a-field--third { grid-column: 1 / -1; }
  .a-fold__head { padding: 0.75rem 0.8rem; }
  .a-fold__body { padding: 0.85rem 0.8rem; }
}

/* Cloudflare Turnstile widget on the sign-in form */
.turnstile-box { min-height: 65px; margin-block: 0.9rem; }
