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

:root {
  --ink: #111414;
  --ink-soft: #252c2b;
  --muted: #687270;
  --line: rgba(17, 20, 20, 0.13);
  --line-strong: rgba(17, 20, 20, 0.24);
  --surface: #eef1ec;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --sidebar: #0f1514;
  --accent: #00a884;
  --accent-strong: #006f61;
  --accent-cyan: #17a9c2;
  --accent-amber: #d78900;
  --danger: #c23a2f;
  --warning: #ad6400;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(17, 20, 20, 0.09);
  --shadow-tight: 0 8px 22px rgba(17, 20, 20, 0.08);
  --spark: rgba(255, 255, 255, 0.72);
  --motion-fast: 160ms;
  --motion-med: 260ms;
  --motion-slow: 720ms;
}

* {
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(17, 20, 20, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 20, 20, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(0, 168, 132, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(215, 137, 0, 0.08), transparent 32%),
    var(--surface);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
  color: var(--ink);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 8%, rgba(0, 168, 132, 0.09), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(23, 169, 194, 0.08), transparent 26%),
    linear-gradient(115deg, transparent 0 42%, rgba(255, 255, 255, 0.24) 48%, transparent 54% 100%);
  background-size: auto, auto, 220% 220%;
  opacity: 0.72;
}

body.is-ready .main > * {
  animation: panel-enter 520ms cubic-bezier(0.2, 0.9, 0.22, 1) both;
}

body.is-ready .main > *:nth-child(2) {
  animation-delay: 45ms;
}

body.is-ready .main > *:nth-child(3) {
  animation-delay: 90ms;
}

body.is-ready .main > *:nth-child(4) {
  animation-delay: 135ms;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  color: var(--accent);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background:
    linear-gradient(180deg, rgba(0, 168, 132, 0.13), transparent 32%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    var(--sidebar);
  background-size: auto, 28px 28px, 28px 28px, auto;
  color: #f5fbf8;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-family: "Azeret Mono", monospace;
  font-weight: 800;
  line-height: 1.1;
}

.brand:hover {
  color: inherit;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(0, 168, 132, 0.55);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 168, 132, 0.94), rgba(23, 169, 194, 0.86)),
    #00a884;
  color: #06100d;
  font-size: 13px;
  box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.12), 0 16px 30px rgba(0, 0, 0, 0.2);
  transition: transform var(--motion-med) ease, box-shadow var(--motion-med) ease;
}

.brand:hover .brand-mark {
  transform: translateY(-2px) rotate(-3deg);
  box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.18), 0 18px 36px rgba(0, 0, 0, 0.28);
}

.brand small {
  display: block;
  margin-top: 3px;
  color: rgba(245, 251, 248, 0.56);
  font-family: Manrope, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar .nav-link {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: rgba(245, 251, 248, 0.74);
  font-weight: 800;
  transition: color var(--motion-fast) ease, background var(--motion-fast) ease, border-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.sidebar .nav-link::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -70%;
  width: 58%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
  transform: skewX(-18deg);
  transition: left var(--motion-slow) ease;
}

.sidebar .nav-link .lucide {
  transition: transform var(--motion-med) ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.07);
  color: #f5fbf8;
  transform: translateX(3px);
}

.sidebar .nav-link:hover::before,
.sidebar .nav-link:focus::before {
  left: 112%;
}

.sidebar .nav-link:hover .lucide,
.sidebar .nav-link:focus .lucide {
  transform: translateY(-1px) rotate(-7deg);
}

.sidebar .nav-link.active {
  border-color: rgba(0, 168, 132, 0.5);
  background: linear-gradient(90deg, rgba(0, 168, 132, 0.24), rgba(23, 169, 194, 0.1));
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.main {
  padding: 30px clamp(22px, 3vw, 42px);
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-family: "Azeret Mono", monospace;
  font-size: clamp(1.45rem, 2.2vw, 2.15rem);
  font-weight: 800;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 700;
}

.user-chip {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-tight);
  backdrop-filter: blur(12px);
}

.user-chip .role {
  color: var(--muted);
  font-size: 0.8rem;
}

.flash-stack {
  position: fixed;
  z-index: 1060;
  top: 16px;
  right: 16px;
  max-width: min(420px, calc(100vw - 32px));
}

.metric-grid,
.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.facts-grid > div,
.panel,
.form-panel,
.instance-hero,
.action-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  backdrop-filter: blur(14px);
}

.metric,
.facts-grid > div {
  position: relative;
  min-height: 112px;
  padding: 17px;
  overflow: hidden;
  transition: transform var(--motion-med) ease, border-color var(--motion-med) ease, box-shadow var(--motion-med) ease;
}

.metric::before,
.facts-grid > div::before,
.panel::before,
.instance-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-cyan));
}

.metric::after,
.facts-grid > div::after,
.panel::after,
.instance-hero::after,
.action-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0 42%, rgba(255, 255, 255, 0.42) 50%, transparent 58% 100%);
  opacity: 0;
  transform: translateX(-24%);
  transition: opacity var(--motion-med) ease, transform var(--motion-slow) ease;
}

.metric:hover,
.facts-grid > div:hover {
  border-color: rgba(0, 168, 132, 0.28);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.metric:hover::after,
.facts-grid > div:hover::after,
.panel:hover::after,
.instance-hero:hover::after,
.action-tile:hover::after {
  opacity: 1;
  transform: translateX(24%);
}

.console-panel::after,
.console-panel:hover::after,
.panel:has(.log-panel)::after,
.panel:has(.log-preview)::after,
.panel:has(.terminal)::after,
.panel:has(.log-panel):hover::after,
.panel:has(.log-preview):hover::after,
.panel:has(.terminal):hover::after {
  display: none;
}

.metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-content: end;
}

.metric .lucide {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  color: var(--accent-strong);
  opacity: 0.9;
  transition: transform var(--motion-med) ease, color var(--motion-med) ease;
}

.metric:hover .lucide {
  color: var(--accent-cyan);
  transform: rotate(-8deg) scale(1.08);
}

.metric span,
.facts-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong,
.facts-grid strong {
  display: block;
  margin-top: 5px;
  font-family: "Azeret Mono", monospace;
  font-size: 1.85rem;
  line-height: 1;
}

.system-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.system-metric {
  align-content: stretch;
  gap: 6px;
  min-height: 128px;
}

.system-metric small {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-gauge {
  grid-column: 1 / -1;
  align-self: end;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7e2;
}

.metric-gauge span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
  transition: width var(--motion-med) ease;
}

.facts-grid strong {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.panel,
.form-panel {
  position: relative;
  padding: 18px;
  overflow: hidden;
  transition: transform var(--motion-med) ease, border-color var(--motion-med) ease, box-shadow var(--motion-med) ease;
}

.panel-heading,
.toolbar,
.hero-actions,
.inline-form,
.log-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-heading,
.toolbar {
  justify-content: space-between;
  margin-bottom: 15px;
}

.panel-heading h2 {
  margin: 0;
  font-family: "Azeret Mono", monospace;
  font-size: 0.98rem;
  font-weight: 800;
}

.btn {
  position: relative;
  overflow: hidden;
  min-height: 38px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  transform: translateZ(0);
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease, border-color var(--motion-fast) ease, background-color var(--motion-fast) ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active,
.btn.is-tapped {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-color: #06100d;
  --bs-btn-hover-bg: var(--accent-cyan);
  --bs-btn-hover-border-color: var(--accent-cyan);
  --bs-btn-hover-color: #06100d;
  box-shadow: 0 10px 26px rgba(0, 168, 132, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 14px 34px rgba(23, 169, 194, 0.28);
}

.interaction-ripple {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple-pop 560ms ease-out forwards;
}

.btn-outline-secondary {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-bg: #16201d;
  --bs-btn-hover-border-color: #16201d;
  --bs-btn-hover-color: #ffffff;
}

.form-control,
.form-select {
  min-height: 42px;
  border-color: var(--line);
  border-radius: var(--radius);
  background-color: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-weight: 700;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(0, 168, 132, 0.68);
  box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.14);
}

.table {
  margin-bottom: 0;
  --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
  padding: 12px 10px;
  border-bottom-color: rgba(17, 20, 20, 0.08);
}

.table tbody tr {
  transition: background var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.table tbody tr:hover {
  background: rgba(0, 168, 132, 0.06);
  transform: translateX(3px);
}

.table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  font-weight: 900;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 20px;
  font-weight: 800;
}

.status {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  background: #e6ece8;
  color: #33403c;
  text-transform: lowercase;
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
}

.status-running::before,
.status-deploying::before,
.status-updating::before {
  animation: status-ping 1350ms ease-out infinite;
}

.status-running,
.status-deploying,
.status-updating {
  box-shadow: 0 0 0 0 rgba(0, 168, 132, 0.12);
}

.status-running,
.status-success,
.status-generated,
.status-public,
.status-private,
.status-local,
.status-addons,
.status-uploaded {
  background: #dcfce7;
  color: #08744d;
}

.status-core {
  background: #d9f4f7;
  color: #00748a;
}

.status-stopped,
.status-pending,
.status-deleted,
.status-not_configured {
  background: #edf0f3;
  color: #374151;
}

.status-error,
.status-failed,
.status-ssl_failed,
.status-delete_failed,
.status-auth_required {
  background: #fee2e2;
  color: var(--danger);
}

.status-deploying,
.status-updating,
.status-running.status-dot {
  background: #fef3c7;
  color: var(--warning);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.status-note {
  display: block;
  margin-top: 4px;
  max-width: 320px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-detail {
  margin: 0;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-row,
.instance-row {
  display: grid;
  align-items: center;
  gap: 10px;
  color: inherit;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-weight: 800;
  transition: color var(--motion-fast) ease, background var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.timeline-row:hover,
.instance-row:hover {
  color: var(--accent-strong);
  transform: translateX(3px);
}

.timeline-row {
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
}

.timeline-row small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 700;
}

.instance-row {
  grid-template-columns: minmax(0, 1fr) auto auto minmax(140px, 0.5fr);
}

.instance-row small {
  display: block;
  color: var(--muted);
}

.git-history-layout {
  display: grid;
  gap: 14px;
}

.git-repository-tabs {
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.git-repository-tabs .nav-item {
  flex: 0 0 auto;
}

.git-repository-tabs .nav-link {
  position: relative;
  overflow: hidden;
  min-width: 180px;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  text-align: left;
  font-weight: 900;
  transition: transform var(--motion-med) ease, border-color var(--motion-med) ease, background var(--motion-med) ease, color var(--motion-med) ease;
}

.git-repository-tabs .nav-link:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 168, 132, 0.32);
}

.git-repository-tabs .nav-link.active {
  border-color: var(--line);
  border-bottom-color: rgba(255, 255, 255, 0.9);
  background: #fff;
  color: var(--accent-strong);
  font-weight: 700;
}

.git-repository-tabs .nav-link.active::after,
.app-tabs .nav-link.active::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
  animation: tab-underline 360ms cubic-bezier(0.2, 0.9, 0.22, 1) both;
}

.git-repository-tabs .nav-link span,
.git-repository-tabs .nav-link small {
  color: var(--muted);
  font-size: 0.8rem;
}

.git-history,
.git-repository-group {
  display: grid;
  gap: 18px;
}

.git-repository-group {
  scroll-margin-top: 18px;
}

.git-repository-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.git-repository-head h3 {
  margin: 0;
  font-size: 1rem;
}

.git-repository-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.git-repository-meta span:not(.status) {
  max-width: min(520px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-day {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
}

.git-rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.git-rail::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: -18px;
  width: 2px;
  background: linear-gradient(180deg, rgba(0, 168, 132, 0.35), rgba(23, 169, 194, 0.1));
}

.git-day:last-child .git-rail::before {
  bottom: 0;
}

.git-rail span {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 8px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.28), 0 0 18px rgba(0, 168, 132, 0.35);
}

.git-day-content h3 {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-family: "Azeret Mono", monospace;
  font-size: 0.95rem;
  font-weight: 700;
}

.git-day-content h4 {
  margin: 0 0 10px;
  color: #38414a;
  font-size: 0.9rem;
  font-weight: 700;
}

.git-commit-list {
  display: grid;
  gap: 10px;
}

.git-commit-row {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

.git-commit-row:hover {
  border-color: rgba(0, 168, 132, 0.25);
  box-shadow: var(--shadow-tight);
  transform: translateY(-2px);
}

.git-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #e6fbf5;
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
  transition: transform var(--motion-med) ease, background var(--motion-med) ease;
}

.git-commit-row:hover .git-avatar,
.git-repository-head:hover .git-avatar {
  background: #d5fff4;
  transform: rotate(-5deg) scale(1.04);
}

.git-commit-main {
  min-width: 0;
}

.git-commit-head,
.git-commit-subject,
.git-commit-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.git-commit-head {
  margin-bottom: 4px;
}

.git-commit-head span,
.git-commit-meta,
.git-commit-main p {
  color: var(--muted);
  font-size: 0.82rem;
}

.git-commit-subject {
  min-width: 0;
  font-weight: 600;
}

.git-commit-subject span,
.git-commit-main p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-commit-subject code {
  color: #475467;
  font-size: 0.82rem;
}

.git-commit-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #475467;
}

.git-commit-link:hover {
  color: var(--accent-strong);
}

.git-commit-link .lucide {
  width: 14px;
  height: 14px;
}

.git-commit-subject > code {
  margin-left: auto;
}

.git-commit-main p {
  margin: 6px 0 0 26px;
}

.git-commit-meta {
  justify-content: flex-end;
  flex-wrap: wrap;
  text-align: right;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.form-panel {
  max-width: 920px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, rgba(0, 168, 132, 0.24), transparent 46%),
    #0f1514;
  background-size: 30px 30px, 30px 30px, auto, auto;
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.26);
}

.login-panel h1 {
  margin-bottom: 18px;
}

.instance-hero {
  position: relative;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.instance-hero h2 {
  margin: 0;
  font-family: "Azeret Mono", monospace;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 800;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hero-meta span:not(.status) {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e8f7f3;
  color: #164d43;
  font-size: 0.82rem;
  font-weight: 800;
}

.app-tabs {
  margin: 20px 0 14px;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.progress-panel {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 0.4fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.progress-panel:not(.is-finished)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 132, 0.06);
  animation: soft-breath 1800ms ease-in-out infinite;
}

.progress-panel.is-finished {
  display: none;
}

.progress-copy strong,
.progress-copy small {
  display: block;
}

.progress-copy small {
  color: var(--muted);
}

.progress {
  overflow: hidden;
  height: 24px;
  border-radius: 999px;
  background: #dfe7e2;
}

.progress-bar {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
  font-size: 0.78rem;
  font-weight: 700;
  transition: width 520ms cubic-bezier(0.2, 0.9, 0.22, 1);
}

.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.46), transparent);
  transform: translateX(-120%);
  animation: progress-shine 1400ms ease-in-out infinite;
}

.progress-log {
  grid-column: 1 / -1;
  min-height: 120px;
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(0, 168, 132, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 50%, transparent 50%),
    #0f1514;
  background-size: 100% 28px;
  color: #d7fff1;
  font-size: 0.8rem;
}

.app-tabs .nav-link {
  position: relative;
  min-height: 42px;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 900;
  transition: color var(--motion-fast) ease, background var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.app-tabs .nav-link:hover {
  color: var(--accent-strong);
  transform: translateY(-2px);
}

.app-tabs .nav-link.active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  font-weight: 700;
}

.log-row pre,
.log-panel {
  position: relative;
  z-index: 1;
  min-height: 360px;
  max-height: 62vh;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(0, 168, 132, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.026) 50%, transparent 50%),
    linear-gradient(90deg, rgba(0, 168, 132, 0.07), transparent 28%),
    #0f1514;
  background-size: 100% 30px, auto, auto;
  color: #d7fff1;
  font-size: 0.84rem;
}

.log-toolbar {
  margin-bottom: 12px;
}

.log-toolbar .form-select {
  max-width: 220px;
}

.terminal {
  position: relative;
  z-index: 1;
  min-height: 560px;
  padding: 8px;
  border: 1px solid rgba(0, 168, 132, 0.18);
  border-radius: var(--radius);
  background: #0f1514;
}

.path-list {
  display: grid;
  gap: 8px;
}

.path-list > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.path-list span,
.max-320 {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-update-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.manager-update-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.manager-update-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.manager-update-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-update-wide {
  grid-column: 1 / -1;
}

.log-preview {
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(0, 168, 132, 0.18);
  border-radius: var(--radius);
  background: #0f1514;
  color: #d7fff1;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

.backup-policy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.backup-policy-grid label {
  min-width: 0;
}

.backup-policy-grid label > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.policy-check {
  min-height: 42px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.policy-check-disabled {
  opacity: 0.58;
}

.policy-storage {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 28, 29, 0.04);
}

.policy-storage span,
.policy-storage a {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.policy-storage strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-storage a {
  margin-top: 2px;
  color: var(--accent);
  text-decoration: none;
}

.backup-policy-grid > button {
  justify-self: end;
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.section-title svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.oauth-guide {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed rgba(0, 168, 132, 0.38);
  border-radius: var(--radius);
  background: rgba(0, 168, 132, 0.07);
}

.oauth-guide ol {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-weight: 700;
}

.oauth-guide li + li {
  margin-top: 6px;
}

.oauth-guide code {
  color: var(--accent-strong);
  overflow-wrap: anywhere;
  font-weight: 800;
}

.compact-check {
  width: max-content;
  max-width: 100%;
}

.settings-ops-panel {
  display: grid;
  gap: 18px;
}

.automation-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.automation-summary-grid > div {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(0, 168, 132, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 168, 132, 0.08), transparent 48%),
    rgba(255, 255, 255, 0.66);
  transition: transform var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

.automation-summary-grid > div:hover {
  border-color: rgba(0, 168, 132, 0.28);
  transform: translateY(-2px);
}

.automation-summary-grid span,
.automation-summary-grid small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.automation-summary-grid strong {
  display: block;
  overflow: hidden;
  margin: 4px 0 2px;
  color: var(--ink);
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-summary-grid small {
  font-size: 0.72rem;
  text-transform: none;
}

.automation-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.automation-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.automation-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  transition: transform var(--motion-fast) ease, border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}

.automation-toggle:hover {
  border-color: rgba(0, 168, 132, 0.28);
  background: rgba(255, 255, 255, 0.84);
  transform: translateY(-2px);
}

.automation-toggle .form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.12);
}

.automation-toggle strong,
.automation-toggle small {
  display: block;
}

.automation-toggle strong {
  color: var(--ink);
  line-height: 1.2;
}

.automation-toggle small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.config-grid label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.config-grid button {
  width: max-content;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.action-tile {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 14px;
  color: inherit;
  transition: transform var(--motion-med) ease, border-color var(--motion-med) ease, box-shadow var(--motion-med) ease;
}

.action-tile button,
.action-tile.link {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  font-weight: 700;
}

.action-tile small {
  max-width: 220px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.action-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.action-tile:hover .lucide {
  animation: icon-pop 480ms cubic-bezier(0.2, 0.9, 0.22, 1);
}

.action-tile.is-disabled {
  opacity: 0.65;
}

.action-tile button:disabled {
  cursor: not-allowed;
}

.action-tile.wide {
  min-height: 152px;
  display: grid;
  gap: 8px;
}

.connect-as-tile {
  align-content: stretch;
}

.connect-as-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.connect-as-picker {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  width: 100%;
}

.connect-as-search {
  position: relative;
}

.connect-as-search .lucide {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.connect-as-search .form-control {
  min-height: 38px;
  padding-left: 36px;
  font-size: 0.88rem;
}

.connect-as-tile .form-select {
  position: relative;
  z-index: 1;
  min-height: 38px;
  font-size: 0.88rem;
}

.connect-as-picker small {
  max-width: none;
  min-height: 16px;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: left;
}

.connect-as-tile button.btn {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  min-height: 38px;
  display: inline-flex;
  place-items: center;
  align-content: center;
}

.danger-zone {
  border-left: 4px solid var(--danger);
  padding-left: 14px;
}

.is-muted-row {
  opacity: 0.62;
}

.danger-copy {
  max-width: 720px;
  color: var(--muted);
}

.lucide {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.form-control,
.form-select,
.form-check-input {
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.form-check-input:active {
  transform: scale(0.92);
}

.flash-stack .alert {
  animation: toast-pop 420ms cubic-bezier(0.2, 0.9, 0.22, 1) both;
  box-shadow: var(--shadow);
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ripple-pop {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes status-ping {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 28%, transparent);
  }
  72%,
  100% {
    box-shadow: 0 0 0 8px transparent;
  }
}

@keyframes progress-shine {
  0% {
    transform: translateX(-120%);
  }
  58%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes soft-breath {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(0, 168, 132, 0.08), 0 0 0 rgba(0, 168, 132, 0);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(0, 168, 132, 0.2), 0 12px 32px rgba(0, 168, 132, 0.09);
  }
}

@keyframes tab-underline {
  from {
    opacity: 0;
    transform: scaleX(0.24);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes icon-pop {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  42% {
    transform: translateY(-3px) rotate(-8deg) scale(1.14);
  }
}

@keyframes toast-pop {
  from {
    opacity: 0;
    transform: translateX(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  body {
    animation: grid-drift 26s linear infinite;
  }

  body::before {
    animation: light-sweep 14s ease-in-out infinite;
  }

  .git-rail span {
    animation: rail-glow 2100ms ease-in-out infinite;
  }
}

@keyframes grid-drift {
  to {
    background-position: 34px 34px, 34px 34px, 0 0, 0 0, 0 0;
  }
}

@keyframes light-sweep {
  0%,
  100% {
    background-position: 0 0, 0 0, 0 0;
  }
  50% {
    background-position: 0 0, 0 0, 100% 100%;
  }
}

@keyframes rail-glow {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.22), 0 0 14px rgba(0, 168, 132, 0.25);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.16), 0 0 24px rgba(23, 169, 194, 0.36);
  }
}

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

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: relative;
    z-index: 10;
    gap: 14px;
    padding: 16px;
  }

  .sidebar .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar .nav-link {
    min-height: 40px;
  }

  .sidebar form.mt-auto {
    margin-top: 0 !important;
  }

  .workspace-grid,
  .metric-grid,
  .facts-grid,
  .progress-panel,
  .action-grid,
  .config-grid,
  .manager-update-grid,
  .backup-policy-grid,
  .automation-summary-grid,
  .automation-toggle-grid,
  .git-commit-row,
  .git-repository-head {
    grid-template-columns: 1fr;
  }

  .topbar,
  .instance-hero,
  .panel-heading,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-form,
  .log-toolbar {
    flex-wrap: wrap;
  }

  .instance-row {
    grid-template-columns: 1fr;
  }

  .git-day {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
  }

  .git-commit-meta {
    justify-content: flex-start;
    text-align: left;
  }
}
