:root {
  color-scheme: light;
  --admin-ink: #172033;
  --admin-muted: #68778c;
  --admin-line: #dbe3ec;
  --admin-page: #f3f6fa;
  --admin-card: #ffffff;
  --admin-sidebar: #111827;
  --admin-sidebar-active: #263349;
  --admin-accent: #9b5b19;
  --admin-success: #17663a;
  --admin-danger: #9c2e27;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body, #root { min-height: 100%; }
body { margin: 0; color: var(--admin-ink); background: var(--admin-page); }
button, input, select, textarea, a { font: inherit; }

html.admin-i18n-pending body {
  visibility: hidden;
  animation: admin-i18n-safety-reveal 0s 1.5s forwards;
}

@keyframes admin-i18n-safety-reveal {
  to { visibility: visible; }
}

.admin-shell,
.admin-unified-react-shell {
  min-height: 100vh !important;
  display: grid !important;
  grid-template-columns: 264px minmax(0, 1fr) !important;
  align-items: stretch !important;
  background: var(--admin-page) !important;
}

.sidebar.unified-sidebar {
  position: sticky !important;
  z-index: 40;
  top: 0;
  width: 264px !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 22px 14px 16px !important;
  overflow: auto;
  color: #dbe7f5 !important;
  background: var(--admin-sidebar) !important;
  box-shadow: 12px 0 32px rgba(17, 24, 39, .08);
}

.unified-brand { display: grid; gap: 4px; padding: 0 11px 19px; }
.unified-brand strong { color: #fff; font-size: 19px; letter-spacing: -.02em; }
.unified-brand span { color: #8fa2ba; font-size: 11px; }
.unified-environment-pill { width: max-content; margin-top: 8px; padding: 4px 8px; border: 1px solid #3b4c64; border-radius: 999px; color: #b8c8dc !important; font-size: 9px !important; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }

.sidebar.unified-sidebar nav { display: grid !important; gap: 3px !important; }
.sidebar.unified-sidebar nav a {
  min-height: 39px;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 9px 11px !important;
  border-radius: 9px !important;
  color: #c9d5e5 !important;
  background: transparent !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 650;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.sidebar.unified-sidebar nav a:hover { color: #fff !important; background: #1d293b !important; transform: translateX(2px); }
.sidebar.unified-sidebar nav a.active { color: #fff !important; background: var(--admin-sidebar-active) !important; box-shadow: inset 3px 0 #d59a4c; }
.unified-nav-icon { width: 18px; display: inline-grid; place-items: center; color: #96a9c1; font-size: 14px; }
.sidebar.unified-sidebar nav a.active .unified-nav-icon { color: #ffd18d; }
.unified-nav-separator { height: 1px; margin: 8px 10px; background: #2b394e; }

.unified-sidebar-bottom { display: grid; gap: 10px; margin-top: auto; padding: 18px 8px 0; }
.admin-language-control { display: grid; gap: 5px; }
.admin-language-control span { color: #8fa2ba; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.admin-language-select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #3a4a61;
  border-radius: 9px;
  color: #f4f7fb;
  background: #1b2638;
  cursor: pointer;
}
.unified-launchers { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.unified-launchers a { display: grid; place-items: center; min-height: 35px; border: 1px solid #3a4a61; border-radius: 9px; color: #cbd7e6; text-decoration: none; font-size: 10px; font-weight: 800; }
.unified-launchers a:hover { color: #fff; border-color: #657c99; background: #223148; }
.sidebar-note.unified-sidebar-note { margin: 0; padding: 10px; border: 1px solid #344157; border-radius: 10px; color: #91a4bc; background: transparent; font-size: 10px; line-height: 1.45; }

.workspace,
.unified-react-content {
  width: min(1360px, 100%) !important;
  min-width: 0;
  padding: 30px clamp(18px, 4vw, 52px) 72px !important;
  background: var(--admin-page) !important;
}
.admin-unified-react-shell > .unified-react-frame { min-width: 0; background: var(--admin-page) !important; }
.admin-unified-react-shell .unified-react-frame > header {
  min-height: 64px;
  padding: 12px clamp(18px, 4vw, 52px) !important;
  border-bottom: 1px solid var(--admin-line) !important;
  color: var(--admin-ink) !important;
  background: rgba(255, 255, 255, .92) !important;
  backdrop-filter: blur(12px);
}
.admin-unified-react-shell .unified-react-frame > main { padding: 0 !important; background: transparent !important; }
.admin-unified-react-shell .unified-react-frame > main > div { width: min(1360px, 100%); padding: 30px clamp(18px, 4vw, 52px) 72px; }

.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.topbar h1 { margin: 2px 0 7px; color: var(--admin-ink); font-size: clamp(27px, 4vw, 40px); letter-spacing: -.035em; }
.topbar p:not(.eyebrow) { max-width: 760px; margin: 0; color: #617086; line-height: 1.55; }
.eyebrow { margin: 0; color: var(--admin-accent); font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.topbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }

.admin-mobile-toggle { display: none; position: fixed; z-index: 70; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); width: 48px; height: 48px; border: 0; border-radius: 14px; color: #fff; background: #172135; box-shadow: 0 12px 30px rgba(15, 23, 42, .3); font-size: 20px; cursor: pointer; }
.admin-floating-language { position: fixed; z-index: 80; top: 14px; right: 14px; width: 150px; padding: 8px; border: 1px solid var(--admin-line); border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(25, 38, 58, .12); }
.admin-floating-language span { color: #65748a; }
.admin-floating-language .admin-language-select { color: var(--admin-ink); background: #f5f7fa; border-color: var(--admin-line); }

body.admin-login-page { background: radial-gradient(circle at 20% 0, #253754, #111827 58%); }
body.admin-login-page #root > div { background: transparent !important; }
body.admin-login-page #root form,
body.admin-login-page #root > div > div { border: 1px solid rgba(255,255,255,.12); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.28); }

.release-pipeline-card { overflow: hidden; }
.release-environments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.release-environment { position: relative; display: grid; gap: 13px; padding: 18px; border: 1px solid var(--admin-line); border-radius: 15px; background: #f8fafc; }
.release-environment.production { background: linear-gradient(145deg, #fff, #f7faf8); }
.release-environment.test { background: linear-gradient(145deg, #fff, #fff9ed); }
.release-environment-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.release-environment h3 { margin: 2px 0 3px; font-size: 19px; }
.release-environment p { margin: 0; color: var(--admin-muted); font-size: 12px; line-height: 1.45; }
.release-health { padding: 5px 9px; border-radius: 999px; color: #7a2830; background: #f8e3e6; font-size: 10px; font-weight: 900; white-space: nowrap; }
.release-health.healthy { color: #16603a; background: #dff6e8; }
.release-version-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.release-version-grid div { min-width: 0; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.82); }
.release-version-grid small { display: block; margin-bottom: 4px; color: #7b899b; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.release-version-grid b, .release-version-grid code { display: block; overflow: hidden; color: #26364c; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.release-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.release-actions .button { flex: 1 1 150px; }
.release-actions .button.open { color: #21314a; background: #e7edf4; text-decoration: none; display: inline-grid; place-items: center; }
.release-actions .button.promote { color: #fff; background: #23724a; }
.release-actions .button.rollback { color: #8e2f29; border: 1px solid #e5bbb7; background: #fff1ef; }
.release-reason-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 15px; }
.release-reason-row label { display: grid; gap: 6px; }
.release-reason-row span { color: #4e5e74; font-size: 11px; font-weight: 800; }
.release-reason-row input { min-height: 42px; padding: 9px 11px; border: 1px solid #ccd6e2; border-radius: 10px; }
.release-job { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: 15px; padding: 13px; border: 1px solid #dce4ed; border-radius: 12px; background: #f8fafc; }
.release-job-indicator { width: 11px; height: 11px; border-radius: 50%; background: #8b98aa; }
.release-job-indicator.running { background: #d78a1f; box-shadow: 0 0 0 5px rgba(215,138,31,.13); animation: adminPulse 1.2s infinite; }
.release-job-indicator.succeeded { background: #2d8b5b; }
.release-job-indicator.failed { background: #b63d34; }
.release-job strong, .release-job small { display: block; }
.release-job small { margin-top: 3px; color: #76859a; }
.release-log { max-height: 340px; margin: 10px 0 0; padding: 13px; overflow: auto; border-radius: 10px; color: #dce7f5; background: #111827; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
@keyframes adminPulse { 50% { opacity: .45; } }

@media (max-width: 900px) {
  .admin-shell, .admin-unified-react-shell { display: block !important; }
  .sidebar.unified-sidebar { position: fixed !important; inset: 0 auto 0 0; z-index: 65; width: min(310px, 88vw) !important; height: 100dvh !important; transform: translateX(-105%); transition: transform .2s ease; }
  body.admin-nav-open .sidebar.unified-sidebar { transform: translateX(0); }
  body.admin-nav-open::after { content: ""; position: fixed; z-index: 60; inset: 0; background: rgba(7, 12, 22, .56); }
  .admin-mobile-toggle { display: grid; place-items: center; }
  .workspace, .unified-react-content, .admin-unified-react-shell .unified-react-frame > main > div { padding: 22px 16px 82px !important; }
  .release-environments { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .release-version-grid, .release-reason-row { grid-template-columns: 1fr; }
  .release-job { grid-template-columns: auto 1fr; }
  .release-job > button { grid-column: 1 / -1; width: 100%; }
}
