:root {
  --ink: #102a33;
  --ink-soft: #38505a;
  --paper: #f4f0e6;
  --paper-deep: #e9e1d1;
  --card: #fffdf8;
  --line: #d9d0bf;
  --signal: #eb5e28;
  --signal-dark: #b93c12;
  --mint: #9ed8c3;
  --success: #167451;
  --danger: #b42318;
  --warning: #9a5b08;
  --shadow: 0 20px 50px rgba(16, 42, 51, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 3%, rgba(235, 94, 40, .10), transparent 27rem),
    linear-gradient(120deg, transparent 0 48%, rgba(16, 42, 51, .025) 48% 49%, transparent 49% 100%),
    var(--paper);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  min-height: 100vh;
}

a { color: inherit; }
button, input, select { font: inherit; }
button, .button, .mini-button { -webkit-tap-highlight-color: transparent; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: 0 4vw;
  color: #fff;
  background: rgba(16, 42, 51, .96);
  border-bottom: 3px solid var(--signal);
  backdrop-filter: blur(18px);
}

.wordmark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; width: max-content; }
.wordmark span, .brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--signal);
  border-radius: 50% 50% 50% 12px;
  font-weight: 900;
  letter-spacing: -.08em;
}
.wordmark b { font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; letter-spacing: -.02em; }
.topbar nav { display: flex; gap: 30px; }
.topbar nav a { color: #d7e1df; text-decoration: none; font-size: .92rem; font-weight: 700; }
.topbar nav a:hover { color: #fff; }
.operator { justify-self: end; display: flex; align-items: center; gap: 14px; font-size: .83rem; color: #c7d5d3; }
.operator form { margin: 0; }
.operator button { border: 1px solid #526a70; border-radius: 999px; color: #fff; background: transparent; padding: 7px 12px; cursor: pointer; }
.operator button:hover { border-color: var(--signal); }

.page-shell { width: min(1440px, 92vw); margin: 0 auto; padding: 54px 0 70px; }
.page-shell--narrow { width: min(1120px, 92vw); }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 30px; }
.eyebrow, .kicker { margin: 0 0 8px; color: var(--signal-dark); font-size: .72rem; font-weight: 900; letter-spacing: .16em; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
h1 { margin: 0; font-size: clamp(2.5rem, 5.5vw, 5.4rem); line-height: .94; }
h2 { margin: 0; font-size: 1.65rem; }
.lede { max-width: 680px; margin: 18px 0 0; color: var(--ink-soft); font-size: 1.06rem; line-height: 1.6; }

.worker-pill { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; padding: 10px 15px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 253, 248, .78); font-size: .78rem; font-weight: 800; }
.worker-pill--ok { color: var(--success); }
.worker-pill--down { color: var(--danger); }
.pulse { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 18px 4px 18px 4px; box-shadow: var(--shadow); }
.metric span { align-self: center; color: var(--ink-soft); font-weight: 800; }
.metric strong { grid-row: span 2; align-self: center; font-family: Georgia, serif; font-size: 2.5rem; color: var(--ink); }
.metric small { color: #6f7e82; }
.metric--danger { border-color: rgba(180, 35, 24, .35); background: #fff9f5; }
.metric--danger strong { color: var(--danger); }

.workspace-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; margin-bottom: 18px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 22px 5px 22px 5px; box-shadow: var(--shadow); padding: 26px; }
.panel--accent { position: relative; overflow: hidden; }
.panel--accent::after { content: ""; position: absolute; right: -45px; top: -70px; width: 180px; height: 180px; border: 24px solid rgba(235, 94, 40, .09); border-radius: 50%; pointer-events: none; }
.panel--ink { color: #fff; background: var(--ink); border-color: var(--ink); }
.panel--ink .kicker { color: var(--mint); }
.panel--ink p { color: #c9d7d6; line-height: 1.55; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.step-chip, .count-chip { display: grid; place-items: center; min-width: 39px; height: 39px; padding: 0 11px; border-radius: 50% 50% 50% 8px; color: var(--signal-dark); background: #ffe1d3; font-size: .78rem; font-weight: 900; }
.panel--ink .step-chip { color: var(--ink); background: var(--mint); }

.form-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-stack { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: .78rem; font-weight: 900; letter-spacing: .02em; }
input, select { width: 100%; min-height: 45px; padding: 10px 13px; border: 1px solid #bcb3a3; border-radius: 10px 3px 10px 3px; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(235, 94, 40, .14); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 45px; }
.check-row input { width: 18px; min-height: 18px; accent-color: var(--signal); }
.inline-form { display: flex; align-items: center; gap: 9px; margin-top: 14px; }
.inline-form--field input { color: var(--ink); background: #f6faf8; border-color: #60777a; }
.inline-form select { width: auto; min-width: 170px; color: var(--ink); }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 43px; padding: 10px 17px; border: 1px solid transparent; border-radius: 12px 3px 12px 3px; text-decoration: none; font-size: .83rem; font-weight: 900; cursor: pointer; }
.button--wide { width: 100%; }
.button--primary { color: #fff; background: var(--signal); box-shadow: 0 9px 20px rgba(185, 60, 18, .18); }
.button--primary:hover { background: var(--signal-dark); }
.button--light { color: var(--ink); background: var(--mint); }
.button--outline-light { color: #fff; border-color: #789093; background: transparent; }
.button--ghost { color: var(--ink); border-color: var(--line); background: rgba(255, 253, 248, .7); }
.button--danger { color: #fff; background: var(--danger); }

.table-panel { margin-top: 18px; padding: 0; overflow: hidden; }
.table-panel .panel-heading { align-items: center; padding: 24px 26px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th { padding: 12px 18px; color: #718085; background: #f8f5ed; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; font-size: .69rem; letter-spacing: .1em; text-transform: uppercase; }
td { padding: 17px 18px; border-bottom: 1px solid #e7e0d4; vertical-align: top; font-size: .86rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffaf2; }
.actions-heading { width: 380px; }
.instance-name, .operation-link { display: grid; gap: 4px; text-decoration: none; }
code { width: max-content; max-width: 330px; overflow: hidden; text-overflow: ellipsis; color: #52646a; font: .75rem/1.4 "Courier New", monospace; }
.row-error { width: max-content; margin-top: 4px; color: var(--danger); font-size: .72rem; font-weight: 900; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions form { margin: 0; }
.mini-button { display: inline-flex; align-items: center; min-height: 29px; padding: 5px 9px; color: var(--ink); background: #f6f2e9; border: 1px solid #d7cdbc; border-radius: 8px 2px 8px 2px; text-decoration: none; font-size: .7rem; font-weight: 800; cursor: pointer; }
.mini-button:hover { border-color: var(--ink); }
.mini-button--warn { color: var(--warning); background: #fff8e8; }
.mini-button--danger { color: var(--danger); background: #fff5f1; }
.status { display: inline-flex; align-items: center; width: max-content; padding: 5px 9px; border-radius: 999px; color: #52646a; background: #e8edef; font-size: .68rem; font-weight: 900; white-space: nowrap; }
.status--active, .status--present, .status--succeeded { color: #0f6647; background: #dff3e9; }
.status--suspended, .status--failed { color: var(--danger); background: #fde5df; }
.status--queued { color: #755407; background: #fff0be; }
.status--running { color: #095d75; background: #dff3f8; }
td small { display: block; margin-top: 5px; color: #7b6860; }
.empty-cell { padding: 40px; color: #718085; text-align: center; }
.text-link { color: var(--signal-dark); font-size: .82rem; font-weight: 900; text-decoration: none; }

.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-title h1 { font-size: clamp(2.7rem, 5vw, 4.6rem); }
.operation-card { padding: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 24px 5px 24px 5px; box-shadow: var(--shadow); }
.operation-status { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 25px 0; }
.detail-grid div { padding: 15px; background: #f8f4ec; border-radius: 12px 3px 12px 3px; }
.detail-grid dt { color: #718085; font-size: .69rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.detail-grid dd { margin: 7px 0 0; font-weight: 800; }
.result-block { overflow: hidden; border-radius: 14px 4px 14px 4px; background: #0b2028; }
.result-heading { padding: 11px 16px; color: var(--mint); border-bottom: 1px solid #29414a; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
pre { margin: 0; padding: 20px; color: #e3efec; font: .79rem/1.65 "Courier New", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.refresh-note { display: flex; align-items: center; gap: 9px; color: #607178; font-size: .78rem; }
.alert { display: grid; gap: 4px; margin: 18px 0; padding: 14px 16px; border-radius: 10px 3px 10px 3px; }
.alert--danger { color: #8d1c14; background: #fde8e2; border-left: 4px solid var(--danger); }
.retry-form { margin: 18px 0; }

.server-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.server-card { position: relative; display: grid; gap: 12px; min-height: 190px; padding: 25px; overflow: hidden; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 22px 5px 22px 5px; box-shadow: var(--shadow); text-decoration: none; }
.server-card::after { content: ""; position: absolute; width: 130px; height: 130px; right: -45px; top: -45px; border: 18px solid rgba(16, 42, 51, .05); border-radius: 50%; }
.server-card:hover { transform: translateY(-2px); border-color: var(--signal); }
.server-card__top { display: flex; align-items: center; gap: 9px; color: var(--warning); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.server-card--ok .server-card__top { color: var(--success); }
.server-card h2 { margin-top: 5px; }
.server-card__meta { display: flex; gap: 18px; align-self: end; color: #718085; font-size: .76rem; font-weight: 800; }
.empty-card { grid-column: 1 / -1; padding: 45px; color: #718085; background: var(--card); border: 1px dashed var(--line); border-radius: 18px; text-align: center; }
.server-create { margin-top: 18px; }
.field-span { grid-column: 1 / -1; }
.form-help { margin: 0; color: #718085; font-size: .76rem; line-height: 1.55; }
.server-status-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 18px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 16px 4px 16px 4px; box-shadow: var(--shadow); }
.server-status-strip > div { display: grid; gap: 8px; padding: 18px; background: var(--card); }
.server-status-strip span { color: #718085; font-size: .69rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.environment-actions { display: flex; justify-content: space-between; align-items: center; gap: 25px; margin-bottom: 18px; }
.environment-actions p { color: var(--ink-soft); }
.action-cluster { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.action-cluster form { margin: 0; }
.environment-form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.environment-value { display: inline-block; max-width: 460px; overflow-wrap: anywhere; font-family: "Courier New", monospace; font-size: .76rem; }

.login-shell { display: grid; grid-template-columns: minmax(360px, 560px) 1fr; min-height: 100vh; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(35px, 7vw, 90px); background: var(--card); }
.login-panel .brand-mark { width: 55px; height: 55px; margin-bottom: 42px; font-size: 1.1rem; }
.login-panel h1 { max-width: 450px; font-size: clamp(3rem, 6vw, 5.5rem); }
.login-panel .form-stack { margin-top: 35px; }
.security-note { margin-top: 22px; color: #718085; font-size: .72rem; }
.login-atmosphere { position: relative; overflow: hidden; background: var(--ink); }
.login-atmosphere::before { content: ""; position: absolute; inset: 0; opacity: .25; background-image: linear-gradient(rgba(158, 216, 195, .2) 1px, transparent 1px), linear-gradient(90deg, rgba(158, 216, 195, .2) 1px, transparent 1px); background-size: 48px 48px; transform: perspective(400px) rotateX(55deg) scale(1.4); }
.orbit { position: absolute; border: 2px solid rgba(158, 216, 195, .4); border-radius: 50%; }
.orbit--one { width: 560px; height: 560px; top: 9%; left: 16%; box-shadow: 0 0 90px rgba(158, 216, 195, .08); }
.orbit--two { width: 310px; height: 310px; right: -70px; bottom: 5%; border-color: rgba(235, 94, 40, .55); }
.signal-card { position: absolute; left: 12%; bottom: 13%; display: grid; gap: 8px; padding: 22px; color: #fff; background: rgba(10, 31, 39, .86); border-left: 5px solid var(--signal); backdrop-filter: blur(10px); }
.signal-card b { color: var(--mint); letter-spacing: .16em; }
.signal-card span { color: #cbd8d6; }

.confirm-shell { display: grid; place-items: center; min-height: calc(100vh - 70px); padding: 30px; }
.confirm-card { width: min(620px, 100%); padding: clamp(30px, 6vw, 60px); text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 28px 6px 28px 6px; box-shadow: var(--shadow); }
.confirm-card h1 { font-size: clamp(2.4rem, 7vw, 4.5rem); }
.confirm-card p:not(.eyebrow) { color: var(--ink-soft); line-height: 1.6; }
.warning-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 22px; color: #fff; background: var(--signal); border-radius: 50% 50% 50% 14px; font: 900 1.5rem Georgia, serif; }
.target-chip { margin: 25px 0; padding: 14px; background: #f3eee3; border: 1px dashed #b8aa95; border-radius: 10px; font: .86rem "Courier New", monospace; }
.confirm-actions { display: flex; justify-content: center; gap: 12px; }
.confirm-actions form { margin: 0; }

.footer { padding: 20px 4vw 35px; color: #718085; text-align: center; font-size: .72rem; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 20px; }
  .topbar nav { display: none; }
  .operator > span { display: none; }
  .hero { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-atmosphere { display: none; }
  .server-grid { grid-template-columns: 1fr; }
  .server-status-strip { grid-template-columns: 1fr 1fr; }
  .environment-actions { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .page-shell { width: min(94vw, 100%); padding-top: 35px; }
  .wordmark b { display: none; }
  h1 { font-size: 3.1rem; }
  .metrics { grid-template-columns: 1fr; }
  .workspace-grid { gap: 12px; }
  .panel { padding: 20px; border-radius: 16px 4px; }
  .form-grid { grid-template-columns: 1fr; }
  .environment-form { grid-template-columns: 1fr; }
  .field-span { grid-column: auto; }
  .inline-form--field { align-items: stretch; flex-direction: column; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form select { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .operation-card { padding: 20px; }
  .operation-status { align-items: flex-start; flex-direction: column; }
  .page-title { align-items: flex-start; flex-direction: column; }
  .login-panel { padding: 34px 25px; }
  .confirm-actions { align-items: stretch; flex-direction: column; }
  .confirm-actions form, .confirm-actions .button { width: 100%; }
  .server-status-strip { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .panel, .metric, .operation-card { animation: rise .45s both; }
  .metrics .metric:nth-child(2) { animation-delay: .05s; }
  .metrics .metric:nth-child(3) { animation-delay: .1s; }
  .metrics .metric:nth-child(4) { animation-delay: .15s; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
