:root {
  --gelv-admin-stage: url('/assets/platform/platform-ambient-gpt.png');
  --gelv-admin-atlas: url('/assets/platform/gelv-icon-atlas-gpt-v3.png');
  --gelv-admin-jade: #123b38;
  --gelv-admin-gold: #c9a45e;
  --gelv-admin-line: rgba(201, 164, 94, .28);
}

body.gelv-admin-page {
  --gelv-admin-entry-ink: #f0e4c8;
  --gelv-admin-entry-muted: rgba(240, 228, 200, .66);
  --gelv-admin-entry-rust: #d07a58;
}

.gelv-admin-entry-shell {
  position: relative;
  z-index: 40;
  width: min(1420px, calc(100% - 40px));
  margin: 12px auto 0;
  padding: 11px 14px 12px;
  border: 1px solid rgba(229, 210, 164, .24);
  background: rgba(8, 38, 35, .82);
  box-shadow: 0 18px 44px -32px rgba(25, 58, 55, .54);
  -webkit-backdrop-filter: blur(20px) saturate(128%);
  backdrop-filter: blur(20px) saturate(128%);
}

.gelv-admin-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--gelv-admin-entry-ink); }
.gelv-admin-entry-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; min-width: 0; }
.gelv-admin-entry-kicker { color: var(--gelv-admin-entry-rust); font-size: 9px; letter-spacing: .18em; }
.gelv-admin-entry-title b { font: 600 17px/1.2 "Songti SC", "Noto Serif SC", serif; }
.gelv-admin-entry-title small { color: var(--gelv-admin-entry-muted); font-size: 11px; }
.gelv-admin-focus { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 31px; padding: 0; border: 1px solid rgba(229, 210, 164, .28); border-radius: 50%; color: var(--gelv-admin-entry-ink); background: rgba(255, 255, 255, .08); cursor: pointer; }
.gelv-admin-focus-icon,
.gelv-admin-entry-arrow { display: block; flex: 0 0 auto; background-image: var(--gelv-icon-atlas, url('/assets/platform/gelv-icon-atlas-gpt-v3.png')); background-size: 400% 400%; background-repeat: no-repeat; border: 1px solid rgba(229, 210, 164, .22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.gelv-admin-focus-icon { width: 18px; height: 18px; background-position: 33.3333% 0; border-radius: 4px; }
.gelv-admin-focus-icon.is-compress { background-position: 66.6667% 0; }
.gelv-admin-entry-arrow { width: 13px; height: 13px; background-position: 100% 100%; border-radius: 3px; }
.gelv-admin-focus:hover, .gelv-admin-focus:focus-visible { color: #fff4cf; border-color: rgba(213, 170, 88, .72); background: rgba(213, 170, 88, .18); }
.gelv-admin-entry-track { display: flex; align-items: center; gap: 8px; min-height: 74px; overflow-x: auto; overflow-y: visible; padding: 5px 7px 9px; scrollbar-width: thin; scrollbar-color: rgba(213, 170, 88, .42) transparent; scroll-snap-type: x proximity; touch-action: pan-x; cursor: grab; }
.gelv-admin-entry-track.is-dragging { cursor: grabbing; scroll-behavior: auto; }
.gelv-admin-entry-track::-webkit-scrollbar { height: 4px; }
.gelv-admin-entry-track::-webkit-scrollbar-thumb { background: rgba(213, 170, 88, .42); }
.gelv-admin-entry-item { position: relative; flex: 0 0 150px; min-height: 64px; display: grid; grid-template-columns: 40px minmax(0, 1fr) 14px; align-items: center; gap: 8px; padding: 8px 9px; color: var(--gelv-admin-entry-ink); text-decoration: none; border: 1px solid rgba(229, 210, 164, .20); background: rgba(18, 65, 58, .62); transform: translateY(var(--admin-entry-y, 0)) scale(var(--admin-entry-scale, .92)); opacity: var(--admin-entry-opacity, .72); transform-origin: center; transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .25s ease, border-color .2s ease, background-color .2s ease; scroll-snap-align: center; }
.gelv-admin-entry-item:hover, .gelv-admin-entry-item.is-current { border-color: rgba(213, 170, 88, .60); background: rgba(42, 101, 88, .72); }
.gelv-admin-entry-item.is-current { box-shadow: 0 12px 22px -18px rgba(41, 75, 73, .68); }
.gelv-admin-entry-item:focus-visible { outline: 2px solid rgba(229, 210, 164, .82); outline-offset: 3px; }
.gelv-admin-entry-icon { width: 38px; height: 38px; display: block; border: 1px solid rgba(47, 88, 83, .24); background-color: #244d4a; background-image: var(--gelv-admin-atlas); background-size: 400% 400%; background-position: var(--admin-icon-x, 0%) var(--admin-icon-y, 0%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 18px -14px rgba(0, 0, 0, .65); transition: transform .25s cubic-bezier(.2, .8, .2, 1), filter .25s ease; }
.gelv-admin-entry-item[data-icon="0"] { --admin-icon-x: 0%; --admin-icon-y: 0%; }
.gelv-admin-entry-item[data-icon="1"] { --admin-icon-x: 0%; --admin-icon-y: 100%; }
.gelv-admin-entry-item[data-icon="2"] { --admin-icon-x: 0%; --admin-icon-y: 66.6667%; }
.gelv-admin-entry-item[data-icon="3"] { --admin-icon-x: 33.3333%; --admin-icon-y: 66.6667%; }
.gelv-admin-entry-item[data-icon="4"] { --admin-icon-x: 66.6667%; --admin-icon-y: 33.3333%; }
.gelv-admin-entry-item[data-icon="5"] { --admin-icon-x: 0%; --admin-icon-y: 66.6667%; }
.gelv-admin-entry-item[data-icon="6"] { --admin-icon-x: 33.3333%; --admin-icon-y: 66.6667%; }
.gelv-admin-entry-item:hover .gelv-admin-entry-icon, .gelv-admin-entry-item.is-current .gelv-admin-entry-icon { transform: scale(1.06); filter: saturate(1.12) brightness(1.08); }
.gelv-admin-entry-copy { min-width: 0; }
.gelv-admin-entry-copy b, .gelv-admin-entry-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gelv-admin-entry-copy b { font: 600 13px/1.25 "Songti SC", "Noto Serif SC", serif; }
.gelv-admin-entry-copy small { margin-top: 4px; color: var(--gelv-admin-entry-muted); font-size: 9px; }
.gelv-admin-entry-arrow { justify-self: end; opacity: .88; }

body.gelv-admin-focus-mode .gelv-admin-entry-shell { background: rgba(7, 31, 29, .92); box-shadow: 0 18px 48px -26px rgba(0, 0, 0, .72); }
body.gelv-immersive-mode .gelv-admin-entry-shell { border-color: rgba(213,170,88,.56); box-shadow: 0 20px 50px -28px rgba(0,0,0,.78); }
body.gelv-admin-focus-mode .gelv-admin-entry-shell ~ main::before,
body.gelv-admin-focus-mode .gelv-admin-entry-shell ~ .main-wrapper::before,
body.gelv-admin-focus-mode .gelv-admin-entry-shell ~ .wrap::before { opacity: .025; }

@media (max-width: 760px) {
  .gelv-admin-entry-shell { width: calc(100% - 20px); margin-top: 10px; padding: 9px 9px 10px; }
  .gelv-admin-entry-head { align-items: flex-start; }
  .gelv-admin-entry-title { gap: 7px; }
  .gelv-admin-entry-title small { width: 100%; }
  .gelv-admin-entry-track { min-height: 70px; margin-right: -4px; }
  .gelv-admin-entry-item { flex-basis: 136px; min-height: 60px; grid-template-columns: 36px minmax(0, 1fr) 12px; }
  .gelv-admin-entry-icon { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .gelv-admin-entry-item { transition: none; transform: none; }
}

body:has(.admin-layout),
body:has(.login-page),
body:has(.top),
body:has(.topbar) {
  min-height: 100vh;
  background-color: #0b2c2a !important;
  background-image:
    linear-gradient(135deg, rgba(7, 28, 27, .91), rgba(18, 61, 54, .78) 52%, rgba(6, 24, 24, .94)),
    var(--gelv-admin-stage) !important;
  background-position: center top !important;
  background-size: cover !important;
  background-attachment: fixed !important;
}

body:has(.admin-layout) .main-wrapper,
body:has(.admin-layout) .login-page,
body:has(.top) .wrap,
body:has(.topbar) main {
  position: relative;
  isolation: isolate;
}

body:has(.admin-layout) .main-wrapper::before,
body:has(.admin-layout) .login-page::before,
body:has(.top) .wrap::before,
body:has(.topbar) main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--gelv-admin-atlas) 100% 8% / min(620px, 48vw) auto no-repeat;
  opacity: .075;
  mix-blend-mode: screen;
}

body:has(.admin-layout) .main-wrapper > *,
body:has(.admin-layout) .login-page > *,
body:has(.top) .wrap > *,
body:has(.topbar) main > * {
  position: relative;
  z-index: 1;
}

body:has(.admin-layout) .sidebar {
  background-color: rgba(8, 37, 35, .92) !important;
  background-image: linear-gradient(180deg, rgba(14, 65, 58, .78), rgba(7, 27, 27, .95)), var(--gelv-admin-atlas) !important;
  background-position: center, 100% 4% !important;
  background-size: auto, 460px auto !important;
  border-right-color: var(--gelv-admin-line) !important;
  box-shadow: 18px 0 44px -34px rgba(0, 0, 0, .8);
}

body:has(.admin-layout) .sidebar-header,
body:has(.admin-layout) .header {
  border-color: var(--gelv-admin-line) !important;
}

body:has(.admin-layout) .nav-item:hover,
body:has(.admin-layout) .nav-item:focus-visible {
  background: rgba(201, 164, 94, .16) !important;
  color: #fff7e6 !important;
}

body:has(.admin-layout) .nav-item.active {
  background: linear-gradient(90deg, rgba(170, 73, 54, .96), rgba(132, 59, 46, .82)) !important;
  box-shadow: inset 3px 0 0 #f0d18d, 0 12px 28px -20px rgba(0, 0, 0, .8);
}

body:has(.admin-layout) .card,
body:has(.admin-layout) .stat-card,
body:has(.admin-layout) .login-card {
  border-color: rgba(201, 164, 94, .20) !important;
  box-shadow: 0 20px 54px -26px rgba(0, 0, 0, .46) !important;
}

body:has(.admin-layout) .card:hover,
body:has(.admin-layout) .stat-card:hover,
body:has(.admin-layout) .card:focus-within,
body:has(.admin-layout) .stat-card:focus-within,
body:has(.admin-layout) .login-card:focus-within {
  border-color: rgba(201, 164, 94, .56) !important;
  box-shadow: 0 24px 58px -24px rgba(0, 0, 0, .62), 0 0 0 3px rgba(201, 164, 94, .10) !important;
}

body:has(.top) .top,
body:has(.topbar) .topbar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: rgba(7, 32, 30, .88) !important;
  background-image: linear-gradient(90deg, rgba(7, 32, 30, .96), rgba(18, 73, 63, .64)), var(--gelv-admin-atlas) !important;
  background-position: center, 100% 48% !important;
  background-size: cover, 520px auto !important;
  border-bottom-color: var(--gelv-admin-line) !important;
}

body:has(.top) a.card {
  border-color: rgba(201, 164, 94, .34) !important;
  background: rgba(251, 247, 237, .88) !important;
  box-shadow: 0 18px 38px -24px rgba(0, 0, 0, .5) !important;
}

body:has(.top) a.card:hover,
body:has(.top) a.card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(201, 164, 94, .78) !important;
  box-shadow: 0 26px 48px -24px rgba(0, 0, 0, .62), 0 0 0 3px rgba(201, 164, 94, .12) !important;
}

body:has(.topbar) .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
}

body:has(.topbar) .band,
body:has(.topbar) .kpi,
body:has(.topbar) .upload-block,
body:has(.topbar) .job-panel {
  position: relative;
  isolation: isolate;
  border-color: rgba(75, 111, 101, .34) !important;
  box-shadow: 0 18px 46px -30px rgba(8, 39, 36, .7) !important;
}

body:has(.topbar) .band::after,
body:has(.topbar) .kpi::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--gelv-admin-atlas) 100% 50% / 360px auto no-repeat;
  opacity: .045;
}

body:has(.topbar) .band:hover,
body:has(.topbar) .kpi:hover,
body:has(.topbar) .upload-block:focus-within,
body:has(.topbar) .job-panel:focus-within {
  border-color: rgba(201, 164, 94, .58) !important;
  box-shadow: 0 22px 48px -26px rgba(8, 39, 36, .82), 0 0 0 3px rgba(201, 164, 94, .10) !important;
}

body:has(.topbar) .band-head {
  background: linear-gradient(90deg, rgba(18, 74, 64, .10), transparent 74%);
}

body:has(.topbar) .data-table tbody tr:focus-within,
body:has(.topbar) .data-table tbody tr:hover {
  box-shadow: inset 3px 0 0 var(--gelv-admin-gold);
}

body:has(.topbar) .field:focus,
body:has(.topbar) input:focus,
body:has(.topbar) select:focus,
body:has(.topbar) textarea:focus,
body:has(.topbar) button:focus-visible,
body:has(.topbar) a:focus-visible {
  outline: 2px solid rgba(201, 164, 94, .74) !important;
  outline-offset: 2px;
}

body:has(.topbar) .detail-actions {
  border-top-color: var(--gelv-admin-line) !important;
  background: rgba(9, 42, 38, .88) !important;
}

body:has(.topbar) .detail-actions button,
body:has(.topbar) .detail-actions a { color: #f7edda; }

body:has(.admin-layout) .btn,
body:has(.topbar) .btn,
body:has(.top) a.card,
body:has(.topbar) .kpi,
body:has(.topbar) .band {
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease, background-color .24s ease;
}

@media (max-width: 760px) {
  body:has(.admin-layout),
  body:has(.login-page),
  body:has(.top),
  body:has(.topbar) {
    background-attachment: scroll !important;
  }

  body:has(.topbar) .topbar { position: relative; }
  body:has(.top) .top { padding-inline: 16px !important; }
  body:has(.top) .wrap { margin-top: 18px; }
  body:has(.topbar) main { padding: 12px !important; }
  body:has(.topbar) .band::after,
  body:has(.topbar) .kpi::after { opacity: .025; }
}

@media (prefers-reduced-motion: reduce) {
  body:has(.admin-layout) .card,
  body:has(.admin-layout) .stat-card,
  body:has(.top) a.card,
  body:has(.topbar) .band,
  body:has(.topbar) .kpi { transition: none; }
}
