:root {
  --bg: #07111f;
  --bg-soft: rgba(12, 22, 39, 0.8);
  --panel: rgba(11, 18, 34, 0.78);
  --panel-strong: rgba(8, 14, 28, 0.92);
  --panel-border: rgba(146, 169, 213, 0.16);
  --panel-border-strong: rgba(146, 169, 213, 0.28);
  --text: #f4f7fb;
  --text-soft: #a9b7cf;
  --text-muted: #7d8ca8;
  --accent: #7dd3fc;
  --accent-strong: #22c3ee;
  --success: #41d39d;
  --warning: #f0b35d;
  --danger: #ff7c8b;
  --shadow: 0 28px 70px rgba(3, 7, 18, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 195, 238, 0.18), transparent 35%),
    radial-gradient(circle at bottom right, rgba(86, 120, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #04101b 0%, #07111f 50%, #040a13 100%);
}

.cms-loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  gap: 1rem;
  background: rgba(4, 10, 19, 0.96);
}

.cms-loader__mark {
  width: 4.8rem;
  height: 4.8rem;
  display: grid;
  place-items: center;
  border-radius: 1.4rem;
  border: 1px solid rgba(125, 211, 252, 0.2);
  background: rgba(255, 255, 255, 0.04);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.cms-loader__bar {
  width: min(18rem, calc(100% - 3rem));
  height: 0.22rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.cms-loader__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 18px rgba(34, 195, 238, 0.36);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.cms-body {
  position: relative;
  overflow-x: hidden;
}

.cms-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.cms-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}

.cms-orb--one {
  width: 26rem;
  height: 26rem;
  top: -8rem;
  right: -7rem;
  background: rgba(34, 195, 238, 0.22);
}

.cms-orb--two {
  width: 22rem;
  height: 22rem;
  bottom: -6rem;
  left: -6rem;
  background: rgba(125, 211, 252, 0.15);
  animation-delay: -9s;
}

.cms-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.03) 1px, transparent 1px);
  background-size: 3rem 3rem;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
}

.cms-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.cms-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100vh;
  padding: 1.5rem;
  background: rgba(7, 14, 28, 0.84);
  border-right: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
}

.cms-brand__link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
}

.cms-brand__logo,
.cms-brand__mark {
  width: 3rem;
  height: 3rem;
  border-radius: 16px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.26), rgba(34, 195, 238, 0.1));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.cms-brand__copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cms-brand__copy strong {
  font-size: 1rem;
}

.cms-brand__copy small,
.cms-nav__link small,
.cms-secondary-link,
.cms-topbar__copy p,
.field-help,
.metric-card__detail,
.timeline-item p,
.media-card__body p,
.project-admin-card p,
.login-copy p,
.login-points,
.cms-user-pill span {
  color: var(--text-soft);
}

.cms-nav {
  display: grid;
  gap: 0.7rem;
}

.cms-nav__link {
  display: grid;
  gap: 0.28rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid transparent;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.cms-nav__link:hover,
.cms-nav__link.is-active {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--panel-border-strong);
}

.cms-nav__link span,
.section-card__header h2,
.project-admin-card h2,
.media-card__body h2,
.login-copy h1,
.login-card h2 {
  font-family: "Sora", sans-serif;
}

.cms-sidebar__footer {
  margin-top: auto;
  display: grid;
  gap: 0.75rem;
}

.cms-secondary-link {
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(146, 169, 213, 0.12);
}

.cms-main {
  padding: 1.6rem;
}

.cms-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 1.5rem;
}

.cms-topbar__copy {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.cms-topbar__copy h1 {
  margin: 0.15rem 0 0.35rem;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.1;
}

.cms-topbar__copy p {
  margin: 0;
  max-width: 48rem;
}

.cms-eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.cms-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.cms-user-pill {
  display: grid;
  gap: 0.15rem;
  min-width: 10rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
}

.cms-menu-toggle {
  display: none;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.cms-menu-toggle span {
  display: block;
  width: 1.2rem;
  height: 2px;
  margin: 0.28rem auto;
  background: var(--text);
  border-radius: 999px;
}

.message-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.message-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: rgba(8, 20, 38, 0.86);
  box-shadow: var(--shadow);
}

.message-pill--success {
  border-color: rgba(65, 211, 157, 0.26);
}

.message-pill--error {
  border-color: rgba(255, 124, 139, 0.28);
}

.message-pill__close {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.cms-content,
.stack-layout {
  display: grid;
  gap: 1.25rem;
}

.panel-grid {
  display: grid;
  gap: 1.2rem;
}

.panel-grid--metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.section-card,
.login-card,
.login-copy {
  position: relative;
  padding: 1.4rem;
  background: linear-gradient(180deg, rgba(16, 24, 42, 0.9), rgba(9, 15, 28, 0.88));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.section-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.section-card__header--split {
  align-items: center;
}

.section-card__header h2,
.login-card h2,
.login-copy h1 {
  margin: 0.25rem 0 0;
  font-size: 1.35rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--panel-border-strong);
}

.button--primary {
  background: linear-gradient(135deg, rgba(34, 195, 238, 0.95), rgba(84, 138, 255, 0.85));
  color: #03111d;
  border-color: transparent;
  font-weight: 700;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.02);
}

.button--danger {
  background: rgba(255, 124, 139, 0.12);
  border-color: rgba(255, 124, 139, 0.24);
}

.button--full {
  width: 100%;
}

.metric-card {
  overflow: hidden;
}

.metric-card__label {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.metric-card h2 {
  margin: 0.7rem 0 0.35rem;
  font-family: "Sora", sans-serif;
  font-size: clamp(2rem, 3vw, 2.6rem);
}

.quick-actions,
.timeline-list,
.related-list {
  display: grid;
  gap: 0.95rem;
}

.action-tile,
.timeline-item {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(146, 169, 213, 0.1);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.action-tile:hover,
.timeline-item:hover {
  transform: translateY(-2px);
  border-color: var(--panel-border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.timeline-item.is-hovered {
  box-shadow: 0 18px 38px rgba(3, 7, 18, 0.28);
}

.timeline-item__meta,
.media-card__meta,
.card-actions,
.tag-row,
.sticky-actions,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.timeline-item__meta {
  align-items: center;
  justify-content: space-between;
}

.timeline-item strong,
.action-tile strong,
.project-mini-card h3,
.project-admin-card h2,
.media-card__body h2 {
  font-size: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.38rem 0.68rem;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.1);
  border: 1px solid rgba(125, 211, 252, 0.16);
  color: var(--text);
  font-size: 0.78rem;
}

.pill--accent {
  background: rgba(34, 195, 238, 0.18);
}

.pill--success {
  background: rgba(65, 211, 157, 0.14);
}

.pill--warning {
  background: rgba(240, 179, 93, 0.14);
}

.project-mini-card,
.project-admin-card,
.media-card {
  display: grid;
  gap: 1rem;
}

.project-mini-card__top,
.project-admin-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.project-mini-card p,
.project-admin-card p,
.media-card__body p,
.empty-state p,
.confirm-card p {
  margin: 0.2rem 0 0;
}

.toolbar-grid,
.form-grid {
  display: grid;
  gap: 1rem;
}

.toolbar-grid,
.form-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toolbar-actions {
  align-items: end;
}

.form-grid__full {
  grid-column: 1 / -1;
}

.field-group {
  display: grid;
  gap: 0.45rem;
}

.field-label {
  color: var(--text);
  font-weight: 600;
}

.field-required {
  color: var(--danger);
}

.field-help,
.field-error {
  margin: 0;
  font-size: 0.88rem;
}

.field-error {
  color: #ff98a3;
}

.cms-input {
  width: 100%;
  padding: 0.92rem 1rem;
  border: 1px solid rgba(146, 169, 213, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.cms-input:focus {
  border-color: rgba(125, 211, 252, 0.65);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.08);
}

.cms-input--textarea {
  resize: vertical;
  min-height: 7rem;
}

.cms-input--select option {
  color: #07111f;
}

.cms-input--file {
  padding: 0.75rem;
}

.cms-checkbox {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2rem;
  accent-color: var(--accent-strong);
}

.toggle-field {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(146, 169, 213, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.toggle-field strong {
  display: block;
}

.toggle-field small {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-soft);
}

.form-error-banner {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 124, 139, 0.28);
  background: rgba(255, 124, 139, 0.08);
}

.form-error-banner p {
  margin: 0;
  color: #ffb2bb;
}

.sticky-actions {
  position: sticky;
  bottom: 1rem;
  z-index: 2;
  padding: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: rgba(7, 15, 27, 0.88);
  backdrop-filter: blur(16px);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 0;
}

.meta-grid dt {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.meta-grid dd {
  margin: 0.22rem 0 0;
  font-weight: 600;
}

.media-card__preview,
.preview-panel {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(146, 169, 213, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.media-card__preview {
  aspect-ratio: 16 / 10;
}

.media-card__preview img,
.media-card__preview video,
.preview-panel img,
.preview-panel video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-panel {
  max-height: 36rem;
}

.empty-state,
.confirm-card {
  text-align: center;
}

.empty-state h3,
.confirm-card h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.pagination-shell {
  padding-bottom: 1rem;
}

.pagination-list {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pagination-link {
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(146, 169, 213, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.pagination-link--current {
  border-color: var(--panel-border-strong);
}

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 30rem);
  gap: 1.25rem;
  width: min(68rem, 100%);
}

.login-copy {
  display: grid;
  align-content: center;
  gap: 1rem;
  min-height: 100%;
}

.login-copy h1 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
}

.login-points {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.7rem;
}

.login-card {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.has-error .cms-input,
.has-error .cms-input--select,
.has-error .cms-input--textarea {
  border-color: rgba(255, 124, 139, 0.38);
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, 20px, 0) scale(1.04);
  }
}

@media (max-width: 1100px) {
  .cms-layout {
    grid-template-columns: 1fr;
  }

  .cms-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 20rem);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    z-index: 20;
  }

  .cms-sidebar.is-open {
    transform: translateX(0);
  }

  .cms-main {
    padding: 1rem;
  }

  .cms-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .panel-grid--metrics,
  .panel-grid--two,
  .content-grid,
  .toolbar-grid,
  .form-grid--two,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .cms-topbar {
    flex-direction: column;
  }

  .cms-topbar__actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .cms-topbar__actions,
  .project-mini-card__top,
  .project-admin-card__header,
  .timeline-item__meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .sticky-actions {
    position: static;
  }
}
