/* ==========================================================================
   Bill's Glass Studios CMS
   Admin interface stylesheet
   ========================================================================== */


/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  --bgs-teal-950: #032d30;
  --bgs-teal-900: #063a3d;
  --bgs-teal-800: #0a4c50;
  --bgs-glass-400: #3bc8b4;
  --bgs-glass-300: #83ded2;
  --bgs-glass-100: #dff7f3;
  --bgs-cream: #f7f1e7;
  --bgs-white: #ffffff;
  --bgs-ink: #173033;
  --bgs-muted: #607174;
  --bgs-line: #cbd8d6;
  --bgs-surface: #ffffff;
  --bgs-surface-soft: #f4f8f7;
  --bgs-danger: #9a2f2f;
  --bgs-success: #27643e;
  --bgs-warning: #7d6521;
  --bgs-shadow: rgba(0, 0, 0, 0.22);

  --font-heading: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Roboto", Arial, sans-serif;
}


/* ==========================================================================
   2. Reset and base elements
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bgs-teal-950);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--bgs-ink);
  font-family: var(--font-body);
  line-height: 1.5;
  background:
    radial-gradient(
      circle at top left,
      rgba(59, 200, 180, 0.2),
      transparent 34rem
    ),
    linear-gradient(
      135deg,
      var(--bgs-teal-950),
      var(--bgs-teal-900)
    );
}

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

a {
  color: var(--bgs-teal-800);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--bgs-teal-950);
}

button,
input,
textarea,
select {
  font: inherit;
}

label {
  color: var(--bgs-teal-950);
  font-weight: 700;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.72rem 0.78rem;
  border: 1px solid #a9bcba;
  border-radius: 0.45rem;
  color: var(--bgs-ink);
  background: var(--bgs-white);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--bgs-teal-800);
}

textarea {
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--bgs-teal-800);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.9rem;
  border-bottom: 1px solid #e3ecea;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--bgs-teal-950);
  background: var(--bgs-glass-100);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f7fbfa;
}

tbody tr:last-child td {
  border-bottom: 0;
}

details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bgs-line);
}

details summary {
  color: var(--bgs-danger);
  cursor: pointer;
  font-weight: 700;
}


/* ==========================================================================
   3. Global focus and accessibility
   ========================================================================== */

.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--bgs-glass-400);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  transform: translateY(-180%);
  padding: 0.75rem 1rem;
  border-radius: 0.4rem;
  color: var(--bgs-teal-950);
  background: var(--bgs-white);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}


/* ==========================================================================
   4. Site header and navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 0;
  padding: 0.35rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(131, 222, 210, 0.28);
  color: var(--bgs-white);
  background: rgba(3, 45, 48, 0.93);
  box-shadow: 0 0.65rem 2rem rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}

.site-header__inner {
  display: flex;
  width: min(100%, 90rem);
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--bgs-cream);
  font-family: var(--font-heading);
  text-decoration: none;
}

.brand,
.brand:hover,
.brand:focus,
.brand:focus-visible {
  color: var(--bgs-cream);
  background: transparent;
  border-color: transparent;
  transform: none;
  text-decoration: none;
}

.brand__favicon {
  display: block;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
}

.brand__name {
  color: var(--bgs-cream);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand__descriptor {
  color: var(--bgs-glass-300);
  font-family: var(--font-body);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand__name,
.brand__descriptor {
  transition: none;
}

.brand:hover .brand__name,
.brand:focus .brand__name,
.brand:focus-visible .brand__name {
  color: var(--bgs-cream);
  opacity: 1;
  visibility: visible;
}

.brand:hover .brand__descriptor,
.brand:focus .brand__descriptor,
.brand:focus-visible .brand__descriptor {
  color: var(--bgs-glass-300);
  opacity: 1;
  visibility: visible;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.site-nav__link {
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  padding: 0.55rem 0.72rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 650;
  letter-spacing: 0.045em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--bgs-glass-100);
  background: rgba(131, 222, 210, 0.1);
  border-color: rgba(131, 222, 210, 0.28);
  transform: translateY(-1px);
}

.site-nav__link:focus-visible {
  outline: 3px solid var(--bgs-glass-300);
  outline-offset: 2px;
}

.site-nav__link--logout {
  color: rgba(255, 255, 255, 0.78);
}


/* ==========================================================================
   5. Main layout and page headings
   ========================================================================== */

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  min-height: calc(100vh - 8rem);
  margin: 2rem auto 4rem;
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 1px solid rgba(131, 222, 210, 0.26);
  border-radius: 1.25rem;
  background: rgba(247, 241, 231, 0.97);
  box-shadow: 0 1.5rem 4rem var(--bgs-shadow);
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--bgs-line);
}

.page-heading h1,
.form-section h2,
.empty-state h2 {
  margin: 0;
  color: var(--bgs-teal-950);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.05;
  text-transform: uppercase;
}

.page-heading h1 {
  font-size: clamp(2.1rem, 4vw, 3.6rem);
}

.form-section h2,
.empty-state h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.page-heading p,
.form-section > p,
.empty-state p {
  margin: 0.55rem 0 0;
  color: var(--bgs-muted);
}


/* ==========================================================================
   6. Buttons and linked actions
   ========================================================================== */

.button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  border: 2px solid var(--bgs-glass-300);
  border-radius: 999px;
  color: var(--bgs-teal-950);
  background: var(--bgs-glass-300);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
  color: var(--bgs-teal-950);
  background: var(--bgs-glass-100);
  border-color: var(--bgs-glass-100);
  transform: translateY(-1px);
}

.button-secondary {
  color: var(--bgs-teal-800);
  background: transparent;
  border-color: var(--bgs-teal-800);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  color: var(--bgs-white);
  background: var(--bgs-teal-800);
  border-color: var(--bgs-teal-800);
}

.button-danger {
  color: var(--bgs-white);
  background: var(--bgs-danger);
  border-color: var(--bgs-danger);
}

.button-danger:hover,
.button-danger:focus-visible {
  color: var(--bgs-white);
  background: #762121;
  border-color: #762121;
}

.button-filter {
  min-height: 3rem;
  padding-inline: 1.1rem;
  border-color: var(--bgs-glass-300);
  color: var(--bgs-teal-950);
  background:
    linear-gradient(
      135deg,
      var(--bgs-glass-300),
      var(--bgs-glass-400)
    );
}

.button-filter:hover,
.button-filter:focus-visible {
  color: var(--bgs-teal-950);
  background:
    linear-gradient(
      135deg,
      var(--bgs-glass-100),
      var(--bgs-glass-300)
    );
}

.button--with-icon,
.inline-action,
.table-actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-action {
  color: var(--bgs-teal-800);
  font-weight: 700;
  text-decoration: none;
}

.inline-action:hover,
.inline-action:focus-visible {
  color: var(--bgs-teal-950);
}

.inline-action__arrow {
  transition: transform 160ms ease;
}

.inline-action:hover .inline-action__arrow,
.inline-action:focus-visible .inline-action__arrow {
  transform: translateX(0.2rem);
}

/* Project deletion danger zone */
.danger-zone {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(142, 40, 40, 0.28);
}

.danger-zone__content {
  padding: 1.25rem;
  border: 1px solid rgba(142, 40, 40, 0.38);
  border-radius: 0.75rem;
  background: rgba(142, 40, 40, 0.06);
}

.danger-zone h2 {
  margin-top: 0;
}

.danger-zone__confirmation {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 1rem 0;
  font-weight: 600;
}

.danger-zone__confirmation input {
  width: auto;
  margin-top: 0.25rem;
}

.button-danger {
  color: #ffffff;
  background: #8e2828;
  border-color: #8e2828;
}

.button-danger:hover,
.button-danger:focus-visible {
  background: #6f1f1f;
  border-color: #6f1f1f;
}

.button-danger:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}



/* ==========================================================================
   7. Forms, filters, and field groups
   ========================================================================== */

.project-form {
  display: grid;
  gap: 1.15rem;
}

.field {
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.filter-bar,
.form-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.filter-bar--status {
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(131, 222, 210, 0.18);
  border-radius: 1rem;
  background:
    linear-gradient(
      135deg,
      rgba(6, 58, 61, 0.72),
      rgba(10, 76, 80, 0.48)
    );
}

.filter-field {
  min-width: min(100%, 18rem);
}

.filter-bar--status .filter-field > label {
  color: var(--bgs-glass-100);
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  min-height: 3rem;
  padding-right: 3rem;
  border-color: rgba(131, 222, 210, 0.5);
  border-radius: 0.75rem;
  color: var(--bgs-teal-950);
  background-color: #dfecea;
  color-scheme: light;
  background-image:
    linear-gradient(
      135deg,
      transparent 50%,
      var(--bgs-glass-300) 50%
    ),
    linear-gradient(
      45deg,
      var(--bgs-glass-300) 50%,
      transparent 50%
    ),
    linear-gradient(
      to left,
      rgba(131, 222, 210, 0.14),
      rgba(131, 222, 210, 0.14)
    );
  background-position:
    calc(100% - 1.15rem) 1.3rem,
    calc(100% - 0.85rem) 1.3rem,
    100% 0;
  background-size:
    0.34rem 0.34rem,
    0.34rem 0.34rem,
    2.5rem 100%;
  background-repeat: no-repeat;
  appearance: none;
}

/* Keep both the closed control and the native popup deliberately light.
   Native option hover treatment is browser/OS controlled, so the base and
   selected states both need sufficient contrast on their own. */
.select-wrap select option {
  color: var(--bgs-teal-950);
  background-color: #e7f1ef;
}

.select-wrap select option:checked {
  color: var(--bgs-white);
  background-color: var(--bgs-teal-800);
}

.select-wrap select:hover {
  border-color: var(--bgs-glass-300);
}

.select-wrap select:focus-visible {
  outline: 3px solid var(--bgs-glass-300);
  outline-offset: 2px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.checkbox-card,
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.78rem;
  border: 1px solid var(--bgs-line);
  border-radius: 0.55rem;
  background: var(--bgs-surface-soft);
}

.checkbox-card:has(input:checked),
.toggle-row:has(input:checked) {
  border-color: var(--bgs-glass-400);
  background: var(--bgs-glass-100);
}

.checkbox-card input,
.toggle-row input {
  width: auto;
  margin: 0.2rem 0 0;
}

.toggle-row {
  margin-bottom: 0.75rem;
}

.help,
.muted {
  color: var(--bgs-muted);
  font-size: 0.9rem;
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.4rem 0 0;
  color: var(--bgs-danger);
  font-weight: 700;
}


/* ==========================================================================
   8. Cards, grids, and content panels
   ========================================================================== */

.form-section,
.empty-state,
.stat-card {
  padding: clamp(1rem, 2.5vw, 1.4rem);
  border: 1px solid var(--bgs-line);
  border-radius: 0.9rem;
  background: var(--bgs-surface);
  box-shadow: 0 0.35rem 1.2rem rgba(3, 45, 48, 0.06);
}

.two-column,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.3rem;
  background: var(--bgs-glass-400);
}

.stat-card span,
.stat-card strong {
  display: block;
}

.stat-card span {
  color: var(--bgs-muted);
  font-size: 0.9rem;
}

.stat-card strong {
  color: var(--bgs-teal-950);
  font-family: var(--font-heading);
  font-size: 2.45rem;
  line-height: 1;
}


/* ==========================================================================
   9. Tables and table actions
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--bgs-line);
  border-radius: 0.85rem;
  background: var(--bgs-surface);
}

.table-actions {
  flex-wrap: wrap;
  gap: 0.7rem;
}

.table-actions a {
  color: var(--bgs-teal-800);
  font-weight: 700;
  text-decoration: none;
}

.table-actions a:hover,
.table-actions a:focus-visible {
  color: var(--bgs-teal-950);
}


/* ==========================================================================
   10. Status labels and feedback
   ========================================================================== */

.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid;
  border-radius: 0.65rem;
  background: var(--bgs-white);
}

.flash-success {
  color: var(--bgs-success);
  background: #edf8f0;
}

.flash-error {
  color: var(--bgs-danger);
  background: #fff1f1;
}

.status,
.tag {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.22rem 0.52rem;
  border: 1px solid #aebfbd;
  border-radius: 999px;
  color: var(--bgs-teal-950);
  background: var(--bgs-surface-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-published {
  color: var(--bgs-success);
  border-color: #72a881;
  background: #edf8f0;
}

.status-draft {
  color: var(--bgs-warning);
  border-color: #b9a366;
  background: #fff9e8;
}

.status-hidden,
.status-archived {
  color: #5e6665;
  border-color: #aab3b2;
  background: #f0f2f2;
}


/* ==========================================================================
   11. Media and gallery management
   ========================================================================== */

.image-editor,
.media-editor {
  display: grid;
  grid-template-columns: minmax(190px, 285px) minmax(0, 1fr);
  gap: 1.25rem;
}

.image-preview,
.media-preview {
  position: relative;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--bgs-line);
  border-radius: 0.7rem;
  background:
    linear-gradient(45deg, #e9eeee 25%, transparent 25%),
    linear-gradient(-45deg, #e9eeee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9eeee 75%),
    linear-gradient(-45deg, transparent 75%, #e9eeee 75%),
    #f7f9f8;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.image-preview img,
.media-preview img,
.media-preview video {
  display: block;
  width: 100%;
}

.media-preview video {
  height: auto;
  max-height: 24rem;
  max-width: 100%;
  object-fit: contain;
  background: var(--bgs-teal-950);
}

.media-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: var(--bgs-white);
  background: rgba(3, 45, 48, 0.82);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.media-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.video-upload-form.is-uploading {
  cursor: progress;
}

.video-upload-form .video-upload-submit:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.upload-status {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(59, 200, 180, 0.42);
  border-radius: 0.7rem;
  color: var(--bgs-teal-950);
  background: var(--bgs-glass-100);
}

.upload-status[hidden] {
  display: none;
}

.upload-status strong,
.upload-status small {
  display: block;
}

.upload-status small {
  margin-top: 0.15rem;
  color: var(--bgs-muted);
}

.upload-spinner {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  border: 0.2rem solid rgba(6, 58, 61, 0.18);
  border-top-color: var(--bgs-teal-800);
  border-radius: 50%;
  animation: bgs-upload-spin 0.8s linear infinite;
}

@keyframes bgs-upload-spin {
  to {
    transform: rotate(360deg);
  }
}

.image-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.image-heading h2 {
  overflow-wrap: anywhere;
}


/* ==========================================================================
   12. Login page
   ========================================================================== */

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: min(100%, 30rem);
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border: 1px solid rgba(131, 222, 210, 0.35);
  border-radius: 1.25rem;
  color: var(--bgs-ink);
  background: rgba(247, 241, 231, 0.98);
  box-shadow: 0 1.5rem 4rem var(--bgs-shadow);
}

.login-card h1 {
  margin: 0;
  color: var(--bgs-teal-950);
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.login-card .eyebrow {
  margin: 0 0 0.55rem;
  color: var(--bgs-teal-800);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-card form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.login-card .button {
  width: 100%;
  margin-top: 0.25rem;
}


/* ==========================================================================
   13. Icon utilities
   ========================================================================== */

.icon,
.site-nav__icon,
.flash__icon,
.field-error__icon {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  stroke-width: 2;
  vertical-align: middle;
}

.site-nav__icon,
.button__icon,
.inline-action__icon,
.inline-action__arrow,
.table-action__icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.flash__icon,
.field-error__icon {
  margin-top: 0.12rem;
}

.flash-success .flash__icon {
  color: var(--bgs-glass-400);
}

.flash-error .flash__icon,
.field-error__icon {
  color: currentColor;
}


/* ==========================================================================
   14. Responsive layout
   ========================================================================== */

.login-site-link {
  margin: 1.4rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(6, 58, 61, 0.12);
  font-size: 0.78rem;
  text-align: center;
}

.login-site-link a {
  color: rgba(6, 58, 61, 0.68);
  text-decoration: none;
}

.login-site-link a:hover,
.login-site-link a:focus-visible {
  color: var(--bgs-teal-800);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

@media (max-width: 68rem) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
  }
}

@media (max-width: 47.5rem) {
  .site-header,
  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .site-header {
    position: static;
  }

  .site-nav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .site-nav__link {
    width: 100%;
    justify-content: flex-start;
    border-color: rgba(131, 222, 210, 0.16);
    background: rgba(255, 255, 255, 0.035);
  }

  .page-shell {
    width: min(100% - 1rem, 1180px);
    margin-top: 0.5rem;
    border-radius: 0.85rem;
  }

  .two-column,
  .checkbox-grid,
  .stat-grid,
  .image-editor,
  .media-editor,
  .media-upload-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar--status {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-field,
  .button-filter,
  .button,
  .form-actions .button {
    width: 100%;
  }
}


/* ==========================================================================
   15. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .upload-spinner {
    animation: none !important;
    border-color: var(--bgs-teal-800);
    border-right-color: transparent;
  }
}

/* ========================================================================== 
   16. Final visual polish — 2026 public-site alignment
   ========================================================================== */

body {
  background:
    radial-gradient(
      circle at 12% -8%,
      rgba(59, 200, 180, 0.28),
      transparent 30rem
    ),
    radial-gradient(
      circle at 92% 18%,
      rgba(131, 222, 210, 0.11),
      transparent 26rem
    ),
    linear-gradient(
      145deg,
      #02282b 0%,
      var(--bgs-teal-950) 44%,
      #052f31 100%
    );
  background-attachment: fixed;
}

.site-header {
  padding-block: 0.55rem;
  border-bottom-color: rgba(131, 222, 210, 0.22);
  background: rgba(2, 40, 43, 0.92);
}

.brand {
  gap: 0.8rem;
}

.brand__logo {
  display: block;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0.4rem 0.75rem rgba(0, 0, 0, 0.18));
}

.brand__name {
  font-size: 1.35rem;
  letter-spacing: 0.045em;
}

.brand__descriptor {
  color: rgba(131, 222, 210, 0.88);
  letter-spacing: 0.125em;
}

.site-nav__link {
  border-radius: 0.65rem;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  background: rgba(131, 222, 210, 0.09);
}

.page-shell {
  width: min(1220px, calc(100% - 2rem));
  margin-top: clamp(1.25rem, 3vw, 2.5rem);
  padding: clamp(1.1rem, 2.8vw, 2.35rem);
  border-color: rgba(131, 222, 210, 0.2);
  border-radius: 1.4rem;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(247, 241, 231, 0.985)
    );
  box-shadow:
    0 1.75rem 4.5rem rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}

.page-heading {
  margin-bottom: 1.75rem;
  padding-bottom: 1.35rem;
}

.page-heading h1 {
  font-size: clamp(2.25rem, 4.4vw, 4rem);
  letter-spacing: -0.025em;
}

.page-heading p {
  max-width: 48rem;
  font-size: 1rem;
}

.button {
  min-height: 2.95rem;
  padding-inline: 1.15rem;
  box-shadow: 0 0.35rem 0.8rem rgba(3, 45, 48, 0.08);
}

.button:hover,
.button:focus-visible {
  box-shadow: 0 0.55rem 1rem rgba(3, 45, 48, 0.12);
}

input,
textarea,
select {
  min-height: 2.9rem;
  border-color: #b9c9c7;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

textarea {
  min-height: auto;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--bgs-glass-400);
  background: var(--bgs-white);
  box-shadow: 0 0 0 4px rgba(59, 200, 180, 0.12);
}

.form-section,
.empty-state,
.stat-card {
  border-color: rgba(6, 58, 61, 0.14);
  border-radius: 1rem;
  box-shadow:
    0 0.5rem 1.4rem rgba(3, 45, 48, 0.055),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.form-section {
  position: relative;
  overflow: hidden;
}

.form-section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.18rem;
  background: linear-gradient(
    180deg,
    var(--bgs-glass-300),
    rgba(59, 200, 180, 0.25)
  );
}

.stat-grid {
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  min-height: 8.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1.35rem;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.98),
      rgba(223, 247, 243, 0.42)
    );
}

.stat-card::before {
  width: 0.22rem;
  background: linear-gradient(
    180deg,
    var(--bgs-glass-300),
    var(--bgs-glass-400)
  );
}

.stat-card span {
  font-weight: 700;
  letter-spacing: 0.025em;
}

.stat-card strong {
  font-size: clamp(2.65rem, 6vw, 3.6rem);
  letter-spacing: -0.035em;
}

.filter-bar--status {
  border-color: rgba(131, 222, 210, 0.25);
  box-shadow: 0 0.65rem 1.5rem rgba(3, 45, 48, 0.09);
}

.table-wrap {
  border-color: rgba(6, 58, 61, 0.16);
  border-radius: 1rem;
  box-shadow: 0 0.45rem 1.25rem rgba(3, 45, 48, 0.05);
}

th {
  padding-block: 0.82rem;
  background:
    linear-gradient(
      180deg,
      rgba(223, 247, 243, 0.95),
      rgba(223, 247, 243, 0.72)
    );
}

td {
  background: rgba(255, 255, 255, 0.84);
}

tbody tr:hover td {
  background: rgba(223, 247, 243, 0.34);
}

.status,
.tag {
  border-radius: 0.5rem;
  letter-spacing: 0.015em;
}

.image-preview {
  border-radius: 0.9rem;
  box-shadow: 0 0.45rem 1rem rgba(3, 45, 48, 0.08);
}

.flash {
  border-radius: 0.85rem;
  box-shadow: 0 0.35rem 1rem rgba(3, 45, 48, 0.05);
}

.login-page {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.login-page::before,
.login-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  border: 1px solid rgba(131, 222, 210, 0.14);
  border-radius: 50%;
}

.login-page::before {
  width: 34rem;
  height: 34rem;
  top: -18rem;
  right: -10rem;
}

.login-page::after {
  width: 24rem;
  height: 24rem;
  bottom: -13rem;
  left: -8rem;
}

.login-card {
  width: min(100%, 31rem);
  padding: clamp(1.6rem, 5vw, 2.6rem);
  border-color: rgba(131, 222, 210, 0.32);
  border-radius: 1.5rem;
  background:
    linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.985),
      rgba(247, 241, 231, 0.98)
    );
  box-shadow:
    0 2rem 5rem rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.login-brand {
  display: flex;
  min-height: 5rem;
  align-items: center;
  justify-content: flex-start;
  margin: -0.25rem 0 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(6, 58, 61, 0.14);
}

.login-brand img {
  width: min(100%, 13rem);
  max-height: 6.5rem;
  object-fit: contain;
  object-position: left center;
}

.login-card h1 {
  max-width: 20rem;
  font-size: clamp(2.55rem, 8vw, 4.35rem);
  letter-spacing: -0.035em;
}

.login-card .eyebrow {
  color: var(--bgs-teal-800);
  letter-spacing: 0.16em;
}

.login-card form {
  margin-top: 1.75rem;
}

@media (max-width: 68rem) {
  .brand__logo {
    width: 2.75rem;
    height: 2.75rem;
  }
}

@media (max-width: 47.5rem) {
  .site-header {
    padding: 0.75rem;
  }

  .site-header__inner {
    gap: 0.85rem;
  }

  .brand__name {
    font-size: 1.15rem;
  }

  .brand__descriptor {
    font-size: 0.6rem;
    white-space: normal;
  }

  .page-shell {
    width: calc(100% - 0.75rem);
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 0.9rem;
  }

  .stat-card {
    min-height: 6.5rem;
  }

  .login-card {
    border-radius: 1.1rem;
  }
}
