/* ABWonderdive Blog — visual identity matched to the booking page sibling
 * (booking.abwonderdive-bali.com). Header, footer, font, body background, and
 * accent borders track booking/static/style.css for cross-site uniformity.
 * Brand color tokens from the resort logo remain available for accents. */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

:root {
  /* Booking-page-aligned palette */
  --c-navy: #001f3f;                              /* primary text + body fallback */
  --c-navy-muted: rgba(0, 31, 63, 0.7);
  --c-divider: rgba(51, 187, 255, 0.3);           /* light-blue header underline */
  --c-paper: #FFFFFF;                             /* header + footer background */
  --c-content-bg: #FFFFFF;                        /* article content card */

  /* Brand accents from the resort logo */
  --c-blue-primary: #2CA9E1;
  --c-green-primary: #8CC63F;
  --c-amber-sunset: #E8A04A;
  --c-sand: #F2EAD3;

  --c-ink: #001f3f;
  --c-ink-muted: rgba(0, 31, 63, 0.6);

  --font-body: "Poppins", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --content-width: 720px;
  --gutter: 24px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-ink);
  background: #f5f7fa;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--c-blue-primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--c-ink);
  letter-spacing: -0.01em;
  margin: 1.4em 0 0.5em;
}
h1 { font-size: 2.1rem; line-height: 1.2; }
h2 { font-size: 1.55rem; line-height: 1.3; }
h3 { font-size: 1.2rem; line-height: 1.35; }

p, ul, ol, blockquote { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.4em; }

/* Slightly roomier paragraphs inside blog posts. Targets the <article> in the public
   post-detail view; admin previews use .admin-article-body and keep their own rhythm. */
article p { margin: 0 0 1.35em; }
article h2 { margin-top: 1.6em; }
article img { border-radius: 8px; margin: 0.4em 0 1.6em; }

blockquote {
  margin: 1.4em 0;
  padding: 0.8em 1.2em;
  background: var(--c-sand);
  border-left: 3px solid var(--c-blue-primary);
  font-style: italic;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
  background: rgba(0, 31, 63, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: rgba(0, 31, 63, 0.06);
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

img { max-width: 100%; height: auto; display: block; }

hr { border: none; border-top: 1px solid var(--c-divider); margin: 2.4em 0; }

/* --- Header --- */

.site-header {
  background: var(--c-paper);
  color: var(--c-ink);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--c-divider);
  grid-row: 1;
}
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  /* 3-column grid: spacer | centered logo | right-aligned nav.
     The spacer column matches the nav column's width so the logo stays optically centered. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.site-header__spacer { /* visual balance for the right-aligned nav */ }
.site-header__logo-link {
  display: block;
  line-height: 0;
  justify-self: center;
}
.site-header .site-logo {
  max-width: 360px;
  height: auto;
  display: block;
}
.site-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-self: end;
}
.site-nav a {
  color: var(--c-ink);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.site-nav a:hover { color: var(--c-blue-primary); }

/* --- Page layout: two-column main + sidebar --- */

main {
  grid-row: 2;
  width: 100%;
  max-width: 1080px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

.page-layout__content {
  background: #FFFFFF;
  padding: 1.75rem 2rem;
  border-radius: 8px;
  border: 1px solid rgba(0,31,63,.08);
}

.page-layout__sidebar {
  position: sticky;
  top: 24px;
  font-size: 14px;
}

.sidebar-block { margin: 0 0 32px; }
.sidebar-block h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ink-muted);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,31,63,.1);
}
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { margin: 0 0 14px; }
.sidebar-list a {
  display: block;
  color: var(--c-ink);
  text-decoration: none;
  line-height: 1.35;
  font-weight: 500;
}
.sidebar-list a:hover { color: var(--c-blue-primary); }
.sidebar-list a[aria-current="page"] { color: var(--c-blue-primary); }
.sidebar-list time {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--c-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-empty {
  font-size: 13px;
  color: var(--c-ink-muted);
  font-style: italic;
}

/* --- Footer (matches booking) --- */

.site-footer {
  background: var(--c-paper);
  color: #000;
  padding: 2rem 1rem;
  grid-row: 3;
}
.site-footer__container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}
.site-footer__column {
  flex: 1;
  min-width: 200px;
  margin: 1rem;
  padding: 0 1rem;
}
.site-footer__column h3 {
  font-size: 1.2rem;
  margin: 0 0 1rem;
  color: #000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  padding-bottom: 0.5rem;
}
.site-footer__column p { margin-bottom: 0.25rem; line-height: 1.6; }
.site-footer__column a { color: #000; text-decoration: none; }
.site-footer__column a:hover { text-decoration: underline; }
.site-footer__column img {
  max-width: 150px;
  height: auto;
  margin-bottom: 0.5rem;
  background: #FFFFFF;
  padding: 5px;
  border-radius: 3px;
}

/* --- Index --- */

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list__item { margin: 0 0 32px; padding-bottom: 32px; border-bottom: 1px solid rgba(0,31,63,.08); }
.post-list__item:last-child { border-bottom: none; padding-bottom: 0; }
.post-list__title { margin: 0 0 6px; font-size: 1.4rem; }
.post-list__title a { color: var(--c-ink); }
.post-list__title a:hover { color: var(--c-blue-primary); text-decoration: none; }
.post-list__meta {
  font-size: 12px;
  color: var(--c-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.post-list__excerpt {
  margin: 8px 0 0;
  color: var(--c-ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Single post --- */

.post-meta {
  font-size: 12px;
  color: var(--c-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.post-status-banner {
  background: var(--c-amber-sunset);
  color: white;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 0 0 24px;
  font-weight: 500;
}

/* --- Admin shell ---
 *
 * The admin uses a flex sidebar layout (more predictable than grid here — the public
 * layout's body{display:grid} can otherwise leak into nested grid behavior). The
 * sidebar is a sticky column with its own scroll context; the content area gets a
 * roomy max-width. All visual atoms (cards, topbar, table, buttons, pills) follow a
 * single accent color (--c-blue-primary) with cool-gray neutrals.
 */

body.admin {
  display: block;                              /* override the public-page grid */
  background: #f4f6fa;
  color: var(--c-ink);
  min-height: 100dvh;                          /* 100dvh — avoids iOS Safari jump */
  font-feature-settings: "cv11", "ss01";
}

.admin-shell {
  display: flex;
  align-items: stretch;
  min-height: 100dvh;
}

.admin-nav {
  flex: 0 0 248px;                             /* fixed width, never shrinks */
  width: 248px;
  background: var(--c-navy);
  color: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 20px 0 16px;
  border-right: 1px solid rgba(0,0,0,0.04);
}
.admin-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
}
.admin-nav__brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-blue-primary) 0%, #1d8fc7 100%);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.18);
}
.admin-nav__brand-text {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: white;
}
.admin-nav__brand-text small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  margin-top: 2px;
}

.admin-nav__list { list-style: none; padding: 0 12px; margin: 0; }
.admin-nav__list li { margin: 2px 0; }
.admin-nav__list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  color: rgba(255,255,255,0.78);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}
.admin-nav__list a:hover {
  background: rgba(255,255,255,0.06);
  color: white;
  text-decoration: none;
}
.admin-nav__list a[aria-current="page"] {
  background: rgba(44, 169, 225, 0.16);
  color: white;
  box-shadow: inset 2px 0 0 var(--c-blue-primary);
}

.admin-nav__footer {
  margin-top: auto;
  padding: 12px 22px 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.admin-nav__user {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.admin-nav__email {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  word-break: break-all;
  margin-bottom: 10px;
}
.admin-nav__signout {
  appearance: none;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  padding: 7px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.admin-nav__signout:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.3);
}

.admin-content {
  flex: 1 1 auto;
  min-width: 0;                                /* allow flex children to shrink properly */
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(244,246,250,0.86);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(0,31,63,0.08);
  padding: 18px 36px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-topbar__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.admin-topbar__subtitle {
  font-size: 13px;
  color: var(--c-ink-muted);
  margin-top: 2px;
}
.admin-topbar__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-main {
  padding: 28px 36px 64px;
  max-width: 1200px;
  width: 100%;
}

.admin-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,31,63,0.04), 0 1px 3px rgba(0,31,63,0.04);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.admin-card--flush { padding: 0; overflow: hidden; }
.admin-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0,31,63,0.06);
}
.admin-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.admin-card__meta {
  font-size: 12px;
  color: var(--c-ink-muted);
}

.admin-flash {
  background: white;
  border: 1px solid rgba(44,169,225,0.25);
  border-left: 3px solid var(--c-blue-primary);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--c-ink);
  margin-bottom: 20px;
}
.admin-flash--warn {
  border-color: rgba(232,160,74,0.4);
  border-left-color: var(--c-amber-sunset);
}

/* Table inside a flush card */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.admin-table thead th {
  text-align: left;
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ink-muted);
  background: #fafbfc;
  border-bottom: 1px solid rgba(0,31,63,0.06);
}
.admin-table tbody td {
  padding: 14px 18px;
  font-size: 14px;
  border-bottom: 1px solid rgba(0,31,63,0.05);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background 120ms ease; }
.admin-table tbody tr:hover { background: rgba(44,169,225,0.04); }
.admin-table tbody tr.is-retracted { opacity: 0.66; }
.admin-table__title-link {
  font-weight: 500;
  color: var(--c-ink);
}
.admin-table__title-link:hover {
  color: var(--c-blue-primary);
  text-decoration: none;
}
.admin-table__sender {
  font-size: 12px;
  color: var(--c-ink-muted);
  word-break: break-word;
  max-width: 28ch;
  display: inline-block;
}
.admin-table__date {
  font-size: 13px;
  color: var(--c-ink);
}
.admin-table__actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.admin-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--c-ink-muted);
}
.admin-empty h3 {
  margin: 0 0 6px;
  font-size: 17px;
  color: var(--c-ink);
}
.admin-empty p { margin: 0; }

/* Status pill — slightly less shouty, single accent family */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 5px;                          /* squarer than fully round */
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill--live { background: rgba(91,150,40,0.12); color: #4a7421; }
.status-pill--preview { background: rgba(232,160,74,0.15); color: #8a5418; }
.status-pill--retracted { background: rgba(0,31,63,0.08); color: rgba(0,31,63,0.55); }

/* --- Card variants used by the post detail view --- */
.admin-card--note {
  background: #fff8e8;
  border-left: 3px solid var(--c-amber-sunset);
  padding: 12px 16px;
  font-size: 13.5px;
  color: rgba(0,31,63,0.78);
}
.admin-card__empty {
  padding: 16px 20px;
  color: var(--c-ink-muted);
  font-size: 13.5px;
  margin: 0;
}

/* Post detail: article + audit aside, two-column at desktop */
.admin-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.admin-card--article { padding: 0; }
.admin-card--audit { padding: 0; position: sticky; top: 88px; }

/* Article body — typography for rendered post HTML */
.admin-article-body {
  padding: 22px 26px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--c-ink);
}
.admin-article-body h1,
.admin-article-body h2,
.admin-article-body h3 { margin-top: 1.4em; }
.admin-article-body h1 { font-size: 1.6rem; }
.admin-article-body h2 { font-size: 1.3rem; }
.admin-article-body h3 { font-size: 1.1rem; }
.admin-article-body p { margin: 0 0 1em; }
.admin-article-body img { border-radius: 6px; margin: 1em 0; }
.admin-article-body a { color: var(--c-blue-primary); }
.admin-article-body a:hover { text-decoration: underline; }

/* Audit timeline */
.admin-audit-list {
  list-style: none;
  padding: 12px 20px 16px;
  margin: 0;
  max-height: 540px;
  overflow-y: auto;
}
.admin-audit-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,31,63,0.05);
  font-size: 13px;
  align-items: start;
}
.admin-audit-item:last-child { border-bottom: none; }
.admin-audit-event {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0,31,63,0.06);
  color: rgba(0,31,63,0.7);
  text-align: center;
  align-self: start;
  width: max-content;
}
.admin-audit-event--ingest { background: rgba(44,169,225,0.14); color: #1e6a8a; }
.admin-audit-event--edit { background: rgba(232,160,74,0.18); color: #8a5418; }
.admin-audit-event--retract { background: rgba(0,31,63,0.1); color: rgba(0,31,63,0.7); }
.admin-audit-event--unretract { background: rgba(91,150,40,0.16); color: #4a7421; }
.admin-audit-event--delete { background: rgba(192,57,43,0.14); color: #8a2e22; }
.admin-audit-event--preview { background: rgba(232,160,74,0.12); color: #8a5418; }
.admin-audit-meta { min-width: 0; }
.admin-audit-actor {
  color: var(--c-ink);
  word-break: break-all;
  font-weight: 500;
  font-size: 12.5px;
}
.admin-audit-time {
  display: block;
  font-size: 11.5px;
  color: var(--c-ink-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Inline form for table-row action buttons */
.admin-inline-form { display: inline-block; margin: 0; }

/* Editor form fields */
.admin-editor-form { display: contents; }

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.admin-field:last-child { margin-bottom: 0; }
.admin-field label,
.admin-field legend {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-ink);
  letter-spacing: 0.01em;
}
.admin-field input[type="text"],
.admin-field input[type="email"],
.admin-field input[type="datetime-local"] {
  width: 100%;
  max-width: none;
  padding: 9px 12px;
  border: 1px solid rgba(0,31,63,0.14);
  border-radius: 7px;
  font: inherit;
  font-size: 14.5px;
  background: white;
  color: var(--c-ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.admin-field input[type="datetime-local"] { max-width: 260px; }
.admin-field input:focus {
  outline: none;
  border-color: var(--c-blue-primary);
  box-shadow: 0 0 0 3px rgba(44,169,225,0.18);
}

.admin-field-row {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.admin-field-row .admin-field { margin-bottom: 0; }

.admin-field--inline {
  border: none;
  padding: 0;
  margin: 0;
}
.admin-field--inline legend { margin-bottom: 6px; padding: 0; }
.admin-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 400;
  margin-right: 18px;
  cursor: pointer;
}
.admin-radio input { accent-color: var(--c-blue-primary); }

/* Editor + preview side by side */
.admin-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}
.admin-editor-grid .admin-card { padding: 0; display: flex; flex-direction: column; }
.admin-editor-textarea {
  flex: 1;
  min-height: 480px;
  border: none;
  padding: 16px 18px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  background: #fdfdfe;
  color: var(--c-ink);
  resize: vertical;
}
.admin-editor-textarea:focus { outline: none; background: white; }
.admin-editor-preview {
  flex: 1;
  min-height: 480px;
  overflow: auto;
}

.admin-editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

/* Filter chips + search on the posts dashboard */
.admin-filters {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.admin-filters__chips {
  display: flex;
  gap: 4px;
  background: white;
  padding: 4px;
  border-radius: 9px;
  box-shadow: 0 1px 2px rgba(0,31,63,0.04), 0 1px 3px rgba(0,31,63,0.04);
}
.admin-chip {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-ink-muted);
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}
.admin-chip:hover {
  color: var(--c-ink);
  background: rgba(0,31,63,0.04);
  text-decoration: none;
}
.admin-chip--active {
  background: var(--c-blue-primary);
  color: white;
}
.admin-chip--active:hover {
  background: #1d8fc7;
  color: white;
}
.admin-filters__search {
  flex: 1;
  max-width: 320px;
  padding: 8px 12px;
  border: 1px solid rgba(0,31,63,0.12);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: white;
  color: var(--c-ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.admin-filters__search:focus {
  outline: none;
  border-color: var(--c-blue-primary);
  box-shadow: 0 0 0 3px rgba(44,169,225,0.18);
}

/* Submit button + live-search spinner */
.admin-filters__submit { /* inherits .btn .btn--ghost .btn--sm sizing */ }
.admin-filters__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(44,169,225,0.25);
  border-top-color: var(--c-blue-primary);
  opacity: 0;
  transition: opacity 120ms ease;
}
.admin-filters__spinner.htmx-request,
.htmx-request .admin-filters__spinner {
  opacity: 1;
  animation: admin-spin 700ms linear infinite;
}
@keyframes admin-spin {
  to { transform: rotate(360deg); }
}

/* Pagination on the audit feed */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 0 4px;
}
.admin-pagination__page {
  font-size: 13px;
  color: var(--c-ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Audit feed payload disclosure */
.admin-audit-payload-summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--c-blue-primary);
  font-weight: 500;
  list-style: none;
}
.admin-audit-payload-summary::-webkit-details-marker { display: none; }
.admin-audit-payload-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 4px;
  transition: transform 120ms ease;
}
details[open] .admin-audit-payload-summary::before { transform: rotate(90deg); }
.admin-audit-payload {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #fafbfc;
  border: 1px solid rgba(0,31,63,0.06);
  border-radius: 6px;
  font-size: 11.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: rgba(0,31,63,0.78);
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 460px;
  max-height: 240px;
  overflow: auto;
}

/* Fade-in for HTMX-swapped rows so the user sees the change happen */
@keyframes admin-row-flash {
  0% { background: rgba(44,169,225,0.15); }
  100% { background: transparent; }
}
.admin-table tbody tr.htmx-added,
.admin-table tbody tr.htmx-settling {
  animation: admin-row-flash 600ms ease-out;
}

@media (max-width: 960px) {
  .admin-detail { grid-template-columns: 1fr; }
  .admin-card--audit { position: static; }
  .admin-editor-grid { grid-template-columns: 1fr; }
  .admin-filters__search { max-width: none; width: 100%; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--c-blue-primary);
  color: white;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
  transition: background 160ms ease, transform 80ms ease, box-shadow 160ms ease;
  box-shadow: 0 1px 2px rgba(0,31,63,0.08);
}
.btn:hover { background: #1d8fc7; color: white; text-decoration: none; box-shadow: 0 2px 6px rgba(44,169,225,0.25); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--c-blue-primary); outline-offset: 2px; }

.btn--primary { background: var(--c-blue-primary); color: white; }
.btn--primary:hover { background: #1d8fc7; }

.btn--ghost {
  background: transparent;
  color: var(--c-ink);
  border: 1px solid rgba(0,31,63,0.14);
  box-shadow: none;
}
.btn--ghost:hover { background: rgba(0,31,63,0.04); color: var(--c-ink); box-shadow: none; }

.btn--danger { background: #c0392b; color: white; }
.btn--danger:hover { background: #a82a1d; color: white; }

.btn--sm { padding: 5px 10px; font-size: 12.5px; }

input[type="email"],
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0,31,63,.15);
  border-radius: 6px;
  font: inherit;
  font-size: 16px;
  background: white;
}
input:focus { outline: 2px solid var(--c-blue-primary); outline-offset: -1px; }

/* --- Mobile --- */

@media (max-width: 920px) {
  .page-layout { grid-template-columns: 1fr; gap: 32px; }
  .page-layout__sidebar { position: static; }
}

@media (max-width: 720px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }
  main { margin: 1rem auto; padding: 0 1rem; }
  .page-layout__content { padding: 1.25rem 1.25rem; }
  .site-header__inner {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0.75rem 1rem;
  }
  .site-header__spacer { display: none; }
  .site-header__logo-link { justify-self: center; }
  .site-nav { justify-self: center; gap: 18px; }
  .site-header .site-logo { max-width: 220px; }
  .site-footer__column { flex-basis: 100%; }
  .admin-shell { flex-direction: column; }
  .admin-nav {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    padding: 12px 8px;
  }
  .admin-nav__brand { padding: 4px 12px 12px; }
  .admin-nav__footer { padding: 12px; border-top: none; margin-top: 8px; }
  .admin-topbar { padding: 14px 20px; }
  .admin-main { padding: 20px var(--gutter) 48px; }
}
