:root {
  --ink: #15213a;
  --muted: #74829b;
  --line: rgba(91, 113, 151, .16);
  --paper: #f2f6fc;
  --panel: rgba(255, 255, 255, .86);
  --dark: #091325;
  --dark-2: #101f38;
  --accent: #5b6cff;
  --cyan: #22c7e8;
  --green: #15b889;
  --blue: #397dff;
  --red: #df5263;
  --shadow: 0 18px 45px rgba(23, 48, 91, .08);
  --glow: 0 0 0 3px rgba(91, 108, 255, .12), 0 12px 30px rgba(57, 125, 255, .13);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 88% 4%, rgba(91, 108, 255, .12), transparent 25rem),
    radial-gradient(circle at 28% 95%, rgba(34, 199, 232, .08), transparent 28rem),
    linear-gradient(rgba(63, 96, 153, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 96, 153, .035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 30px 30px, 30px 30px, auto;
}

body:before {
  content: "";
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  top: -240px;
  right: 8%;
  border: 1px solid rgba(91, 108, 255, .16);
  border-radius: 50%;
  box-shadow: 0 0 90px rgba(91, 108, 255, .1), inset 0 0 90px rgba(34, 199, 232, .06);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 248px;
  padding: 28px 18px;
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(91, 108, 255, .22), transparent 14rem),
    linear-gradient(165deg, #101d34 0%, #081120 58%, #07101e 100%);
  border-right: 1px solid rgba(127, 162, 220, .13);
  box-shadow: 18px 0 55px rgba(11, 27, 55, .12);
}

.sidebar:after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: -145px;
  bottom: 8%;
  border: 35px solid rgba(34, 199, 232, .045);
  border-radius: 50%;
}

.brand { position: relative; z-index: 1; display: flex; gap: 12px; align-items: center; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #fff;
  font-weight: 900;
  letter-spacing: -.03em;
  box-shadow: 0 8px 24px rgba(51, 129, 255, .35), inset 0 1px rgba(255, 255, 255, .3);
}
.brand b, .brand small { display: block; }
.brand b { letter-spacing: .02em; }
.brand small { color: #8292ac; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }

.sidebar nav { position: relative; z-index: 1; margin-top: 42px; display: grid; gap: 7px; }
.sidebar nav a {
  position: relative;
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #91a0b7;
  text-decoration: none;
  transition: .2s ease;
}
.sidebar nav a span { width: 18px; color: #647792; text-align: center; font-size: 16px; transition: .2s; }
.sidebar nav a:hover { color: #fff; background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .055); transform: translateX(2px); }
.sidebar nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(91, 108, 255, .22), rgba(34, 199, 232, .07));
  border-color: rgba(99, 145, 255, .2);
  box-shadow: inset 3px 0 var(--cyan), 0 8px 25px rgba(0, 0, 0, .12);
}
.sidebar nav a.active span { color: #7eeaff; text-shadow: 0 0 12px rgba(34, 199, 232, .7); }

.sidebar-foot { position: relative; z-index: 1; margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.sidebar-foot a, .sidebar-foot button { border: 0; background: none; color: #7788a2; text-decoration: none; font: inherit; cursor: pointer; transition: .2s; }
.sidebar-foot a:hover, .sidebar-foot button:hover { color: #d7e8ff; }

main { min-width: 0; margin-left: 248px; padding: 34px 42px 60px; max-width: 1700px; }
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 27px; }
h1 { margin: 0; font-size: 29px; letter-spacing: -.035em; color: #10203b; }
h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.eyebrow { margin: 0 0 2px; color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .19em; }
.status {
  display: flex;
  align-items: center;
  padding: 8px 13px;
  border: 1px solid rgba(21, 184, 137, .16);
  border-radius: 30px;
  background: rgba(232, 250, 245, .82);
  color: #15956f;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(21, 184, 137, .08);
}
.status i { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(21, 184, 137, .1), 0 0 13px rgba(21, 184, 137, .7); animation: statusPulse 2.2s infinite; }
@keyframes statusPulse { 50% { box-shadow: 0 0 0 8px rgba(21, 184, 137, 0), 0 0 14px rgba(21, 184, 137, .75); } }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 18px; }
.metric, .panel {
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(113, 136, 177, .15);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.metric { overflow: hidden; padding: 22px; transition: .22s ease; }
.metric:before { content: ""; position: absolute; width: 88px; height: 88px; right: -30px; top: -35px; border: 16px solid rgba(91, 108, 255, .055); border-radius: 50%; }
.metric:after { content: ""; position: absolute; inset: auto 22px 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--cyan), transparent); opacity: .65; }
.metric:hover { transform: translateY(-3px); border-color: rgba(91, 108, 255, .25); box-shadow: 0 22px 50px rgba(23, 48, 91, .12); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; margin: 7px 0; font-size: 35px; line-height: 1.2; letter-spacing: -.04em; color: #12284d; }

.split { min-width: 0; display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.split > * { min-width: 0; }
.panel { padding: 20px; margin-bottom: 18px; }
.panel-head, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-head a { color: var(--blue); text-decoration: none; font-weight: 700; }
.toolbar p { color: var(--muted); }

.table-wrap { min-width: 0; max-width: 100%; overflow: auto; border-radius: 11px; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 13px 11px; border-bottom: 1px solid rgba(102, 126, 165, .11); text-align: left; vertical-align: middle; }
th { color: #74829a; background: rgba(239, 244, 251, .75); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
tbody tr { transition: .16s; }
tbody tr:hover { background: rgba(91, 108, 255, .035); }
tbody tr:last-child td { border-bottom: 0; }
td.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code { padding: 4px 7px; border: 1px solid rgba(80, 111, 164, .1); border-radius: 7px; background: #edf2f8; color: #29476f; font: 600 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }

.badge { display: inline-block; padding: 4px 9px; border: 1px solid rgba(93, 113, 145, .1); border-radius: 20px; background: #edf1f6; color: #66738a; font-weight: 700; }
.badge.success { border-color: rgba(21, 184, 137, .12); background: #e6f9f3; color: #13966f; }
.badge.pending { border-color: rgba(244, 144, 53, .12); background: #fff1e5; color: #cf6d23; }
.badge.running { border-color: rgba(57, 125, 255, .12); background: #e9f1ff; color: var(--blue); }
.badge.failed { border-color: rgba(223, 82, 99, .12); background: #ffebee; color: #c94455; }
.badge.cancelled { background: #edf0f4; color: #7a8596; }

.timeline > div { position: relative; padding: 5px 0 15px 20px; border-left: 1px solid rgba(91, 108, 255, .17); }
.timeline i { position: absolute; left: -4px; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--cyan)); box-shadow: 0 0 10px rgba(91, 108, 255, .45); }
.timeline b, .timeline span { display: block; }
.timeline span { color: var(--muted); font-size: 12px; }

.primary, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 9px 15px;
  text-decoration: none;
  cursor: pointer;
  font: 750 13px inherit;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.primary { background: linear-gradient(135deg, #263eeb, #6675ff 58%, #36b8df); color: #fff; box-shadow: 0 8px 20px rgba(70, 91, 237, .22), inset 0 1px rgba(255, 255, 255, .2); }
.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 27px rgba(70, 91, 237, .3); }
.button { border: 1px solid rgba(87, 108, 143, .13); background: linear-gradient(180deg, #fff, #edf2f7); color: var(--ink); box-shadow: 0 3px 9px rgba(21, 42, 75, .05); }
.button:hover { transform: translateY(-1px); border-color: rgba(91, 108, 255, .25); box-shadow: 0 8px 18px rgba(21, 42, 75, .1); }
.delete-form { display: inline-flex; margin: 0; }
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(223, 82, 99, .2);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff5f6, #ffe9ec);
  color: #c83f51;
  cursor: pointer;
  font: 750 13px inherit;
  box-shadow: 0 3px 9px rgba(174, 44, 62, .06);
  transition: transform .18s, box-shadow .18s, border-color .18s, background .18s;
}
.danger-button:hover { transform: translateY(-1px); border-color: rgba(223, 82, 99, .38); background: linear-gradient(180deg, #fff0f2, #ffdde2); box-shadow: 0 8px 18px rgba(174, 44, 62, .13); }

input, textarea, select { width: 100%; border: 1px solid #d9e1ed; border-radius: 10px; background: rgba(255, 255, 255, .92); padding: 10px 11px; outline: none; font: inherit; color: inherit; transition: .18s; }
input:hover, textarea:hover, select:hover { border-color: #bbc9dc; }
input:focus, textarea:focus, select:focus { border-color: #7485ff; box-shadow: 0 0 0 3px rgba(91, 108, 255, .11), 0 7px 18px rgba(57, 125, 255, .08); }
textarea { resize: vertical; }
label { display: grid; gap: 6px; font-weight: 750; color: #243450; }
label small { color: var(--muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; accent-color: var(--accent); }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.inline-form, .job-form { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: end; }
.job-form { grid-template-columns: repeat(4, 1fr); }
.toolbar input { max-width: 360px; }
.danger-note { color: #c64f5d; font-size: 12px; }
.muted { color: var(--muted); }

.flash { padding: 12px 15px; margin-bottom: 16px; border: 1px solid rgba(57, 125, 255, .12); border-radius: 10px; background: rgba(232, 241, 255, .9); color: var(--blue); box-shadow: 0 8px 20px rgba(57, 125, 255, .06); }
.flash.error { border-color: rgba(223, 82, 99, .13); background: #ffebee; color: #bd3c4d; }
.flash.success { border-color: rgba(21, 184, 137, .13); background: #e7faf4; color: #128d69; }
.empty { color: var(--muted); text-align: center; }
.narrow { max-width: 520px; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 15%, rgba(91, 108, 255, .2), transparent 24rem), radial-gradient(circle at 85% 85%, rgba(34, 199, 232, .12), transparent 26rem), #07101e; }
.login-card { width: min(460px, 100%); overflow: hidden; border: 1px solid rgba(153, 182, 230, .18); border-radius: 23px; background: #fff; box-shadow: 0 35px 100px rgba(0, 0, 0, .42); }
.login-visual { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 65px; color: #fff; background: radial-gradient(circle at 100% 100%, rgba(34, 199, 232, .2), transparent 22rem), linear-gradient(145deg, #122441, #081321 65%); }
.login-visual:before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(109, 140, 195, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(109, 140, 195, .06) 1px, transparent 1px); background-size: 28px 28px; }
.login-visual:after { content: ""; position: absolute; width: 270px; height: 270px; right: -100px; bottom: -100px; border: 48px solid rgba(91, 108, 255, .14); border-radius: 50%; box-shadow: 0 0 60px rgba(34, 199, 232, .08); }
.login-visual > * { position: relative; z-index: 1; }
.login-visual p { color: #72deee; font-size: 11px; font-weight: 900; letter-spacing: .2em; }
.login-visual h1 { margin: 12px 0; color: #fff; font-size: 38px; line-height: 1.25; }
.login-visual span { color: #9caec6; }
.login-form { display: flex; flex-direction: column; gap: 20px; justify-content: center; padding: 65px; }
.login-form .brand { margin-bottom: 22px; }
.login-form > small { color: var(--muted); }
.login-code-note { margin: -6px 0 2px; padding: 13px 14px; border: 1px solid rgba(57, 125, 255, .15); border-radius: 11px; background: #eef4ff; color: #526d94; }
.login-back { color: var(--muted); text-align: center; text-decoration: none; }
.login-back:hover { color: var(--blue); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 10px; background: #b9c5d7; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #8e9db4; background-clip: padding-box; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .inline-form, .job-form { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .sidebar { position: static; width: auto; height: auto; min-height: 0; }
  .sidebar nav { margin-top: 20px; grid-template-columns: repeat(2, 1fr); }
  .sidebar-foot { margin-top: 18px; }
  main { margin: 0; padding: 24px 16px 40px; }
  header { align-items: flex-start; }
  .panel-head, .toolbar { flex-wrap: wrap; }
  .metric-grid, .form-grid, .inline-form, .job-form { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .login-card { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form { padding: 42px 28px; }
}
