:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #eef2f7;
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --primary-soft: #dbeafe;
  --danger: #dc2626;
  --danger-2: #b91c1c;
  --danger-soft: #fee2e2;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --sidebar: #0f172a;
  --sidebar-2: #111827;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 12px 34px rgba(15,23,42,.08);
  --shadow-lg: 0 24px 60px rgba(15,23,42,.14);
  --radius: 18px;
  --radius-sm: 12px;
  --topbar-h: 78px;
  --sidebar-w: 282px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.01em;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.09), transparent 34rem),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 45%, #edf2f7 100%);
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
code { padding: 2px 7px; border-radius: 8px; background:#eef2ff; color:#334155; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:.92em; }
.topbar {
  height: var(--topbar-h);
  padding: 0 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  background: rgba(15,23,42,.98);
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,.08);
  position:sticky;
  top:0;
  z-index:50;
  box-shadow: 0 12px 30px rgba(15,23,42,.18);
}
.brand-wrap { display:flex; align-items:center; gap:12px; min-width:0; }
.brand-mark { width:40px; height:40px; border-radius:14px; display:grid; place-items:center; background:linear-gradient(135deg,#2563eb,#7c3aed); color:#fff; font-size:12px; font-weight:900; letter-spacing:.06em; box-shadow:0 10px 26px rgba(37,99,235,.25); }
.brand-title { font-weight:900; letter-spacing:-.035em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:52vw; }
.brand-subtitle { color:#cbd5e1; font-size:12px; margin-top:2px; }
.top-actions { display:flex; align-items:center; gap:10px; }
.userpill { display:inline-flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid rgba(255,255,255,.10); border-radius:999px; color:#e2e8f0; background:rgba(255,255,255,.04); font-weight:700; }
.dot { width:8px; height:8px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.14); }
.layout { display:grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.sidebar { background:linear-gradient(180deg,var(--sidebar),var(--sidebar-2)); color:#cbd5e1; padding:24px 18px; min-height: calc(100vh - var(--topbar-h)); position:sticky; top:var(--topbar-h); align-self:start; border-right:1px solid rgba(255,255,255,.06); }
.sidebar-section-label { color:#64748b; text-transform:uppercase; font-size:11px; font-weight:900; letter-spacing:.12em; margin:0 8px 12px; }
.nav-link { display:flex; align-items:center; gap:10px; min-height:44px; padding:10px 12px; margin:4px 0; border-radius:12px; color:#dbe4f0; font-weight:800; transition:background .16s ease, color .16s ease, transform .16s ease; }
.nav-link:hover { background:rgba(255,255,255,.08); color:#fff; transform:translateX(2px); }
.sidebar-footer { margin-top:34px; padding:14px 10px; color:#94a3b8; font-size:13px; border-top:1px solid rgba(255,255,255,.08); }
.content { padding:42px 28px 64px; width:100%; min-width:0; }
.container { max-width:1320px; margin:0 auto; }
.page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:22px; }
h1 { margin:0; color:var(--ink); font-size:clamp(28px,3vw,40px); line-height:1.12; letter-spacing:-.05em; font-weight:900; }
h2 { margin:0 0 16px; font-size:23px; letter-spacing:-.035em; }
h3 { margin:0 0 12px; font-size:18px; letter-spacing:-.025em; }
p { margin:0 0 12px; }
.muted { color:var(--muted); }
.kicker { color:var(--muted); font-weight:800; margin-top:8px; }
.card { background:rgba(255,255,255,.96); border:1px solid rgba(226,232,240,.96); border-radius:var(--radius); padding:24px; box-shadow:var(--shadow-md); margin-bottom:20px; backdrop-filter:blur(8px); }
.card-flat { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow-sm); }
.grid { display:grid; gap:18px; }
.cols-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.cols-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.cols-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.actions-inline { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.btn, button, input[type="submit"] { appearance:none; border:0; border-radius:12px; min-height:42px; padding:10px 16px; font:inherit; font-size:14px; font-weight:900; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; transition:transform .14s ease, box-shadow .14s ease, background .14s ease; }
.btn-primary, .btn, button, input[type="submit"] { color:#fff; background:var(--primary); box-shadow:0 10px 24px rgba(37,99,235,.22); }
.btn:hover, button:hover, input[type="submit"]:hover { background:var(--primary-2); transform:translateY(-1px); box-shadow:0 14px 28px rgba(37,99,235,.27); }
.btn-secondary { background:var(--surface-muted); color:var(--ink); box-shadow:none; }
.btn-secondary:hover { background:#dbe3ef; color:var(--ink); box-shadow:none; }
.btn-ghost { background:#e2e8f0; color:var(--ink); box-shadow:none; }
.btn-ghost:hover { background:#cbd5e1; color:var(--ink); box-shadow:none; }
.btn-danger, .danger { background:var(--danger); color:#fff; box-shadow:0 10px 24px rgba(220,38,38,.18); }
.btn-danger:hover, .danger:hover { background:var(--danger-2); }
.btn-sm, .small { min-height:34px; padding:7px 11px; font-size:12px; border-radius:10px; }
input, select, textarea, .input { width:100%; min-height:44px; padding:10px 14px; border:1px solid var(--border-strong); border-radius:12px; background:#fff; color:var(--ink); font:inherit; outline:none; transition:border-color .14s ease, box-shadow .14s ease; }
input:focus, select:focus, textarea:focus, .input:focus { border-color:rgba(37,99,235,.75); box-shadow:0 0 0 4px rgba(37,99,235,.12); }
textarea { min-height:110px; resize:vertical; }
label { font-weight:850; color:var(--ink); display:block; margin-bottom:6px; }
.form-row { margin:14px 0; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; }
.form-grid .full { grid-column:1 / -1; }
.form-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:18px; padding-top:16px; border-top:1px solid var(--border); }
.table-wrap { width:100%; overflow:auto; border-radius:var(--radius-sm); border:1px solid var(--border); background:#fff; }
table { width:100%; min-width:850px; border-collapse:separate; border-spacing:0; background:#fff; }
th, td { padding:13px 14px; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle; }
th { background:#f8fafc; color:#334155; font-size:12px; text-transform:uppercase; letter-spacing:.055em; font-weight:900; white-space:nowrap; }
tr:last-child td { border-bottom:0; }
tr:hover td { background:#f8fafc; }
.nowrap { white-space:nowrap; }
.badge { display:inline-flex; align-items:center; gap:6px; min-height:24px; padding:4px 10px; border-radius:999px; font-size:11px; font-weight:950; letter-spacing:.045em; text-transform:uppercase; background:#e2e8f0; color:#334155; }
.badge::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; }
.badge.PENDING { background:#e0f2fe; color:#0369a1; }
.badge.RUNNING { background:var(--primary-soft); color:#1d4ed8; }
.badge.DONE { background:var(--success-soft); color:#15803d; }
.badge.FAILED { background:var(--danger-soft); color:#b91c1c; }
.badge.CANCEL_REQUESTED { background:var(--warning-soft); color:#92400e; }
.badge.CANCELLED { background:#e5e7eb; color:#374151; }
.error { border:1px solid #fecaca; background:#fff1f2; color:#991b1b; border-radius:14px; padding:12px 14px; margin:12px 0; font-weight:750; }
.notice { border:1px solid #bfdbfe; background:#eff6ff; color:#1e40af; border-radius:14px; padding:12px 14px; margin:12px 0; font-weight:750; }
.stat { font-size:34px; font-weight:950; letter-spacing:-.05em; margin-top:4px; }
.meta-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:18px 0; }
.meta-item { padding:16px; border:1px solid var(--border); background:#f8fafc; border-radius:14px; }
.meta-item b { display:block; font-size:13px; color:#334155; margin-bottom:4px; }
hr { border:0; height:1px; background:var(--border); margin:20px 0; }
.hero { min-height:calc(100vh - var(--topbar-h)); display:grid; place-items:center; padding:24px; text-align:center; }
.hero > div, .hero { }
.hero h1 { max-width:860px; margin:0 auto 16px; }
.hero p { max-width:760px; margin:0 auto 22px; color:var(--muted); font-size:18px; }
.login-wrap { min-height:calc(100vh - var(--topbar-h)); display:grid; place-items:center; padding:24px; }
.login-card { width:min(460px,100%); }
.modal { position:fixed; inset:0; background:rgba(15,23,42,.52); display:none; align-items:flex-start; justify-content:center; padding:72px 22px 22px; z-index:100; overflow:auto; }
.modal.is-open { display:flex; }
.modal-panel { width:min(760px,100%); background:#fff; border-radius:22px; box-shadow:var(--shadow-lg); border:1px solid rgba(226,232,240,.9); overflow:hidden; animation:modalIn .16s ease-out; }
.modal-wide .modal-panel { width:min(980px,100%); }
.modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:22px 24px; border-bottom:1px solid var(--border); background:#f8fafc; }
.modal-title { margin:0; font-size:22px; font-weight:950; letter-spacing:-.04em; }
.modal-body { padding:22px 24px; }
.modal-close { background:#e2e8f0; color:var(--ink); box-shadow:none; min-width:38px; padding:8px; }
.perm-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 14px; max-height:360px; overflow:auto; padding:12px; border:1px solid var(--border); border-radius:14px; background:#f8fafc; }
.perm-grid label { display:flex; align-items:center; gap:8px; margin:0; font-weight:750; color:#334155; }
.perm-grid input { width:auto; min-height:0; }
@keyframes modalIn { from { opacity:0; transform:translateY(8px) scale(.99); } to { opacity:1; transform:translateY(0) scale(1); } }
@media (max-width: 1040px) { .cols-4, .cols-3 { grid-template-columns:repeat(2,minmax(0,1fr)); } .meta-grid { grid-template-columns:1fr; } }
@media (max-width: 820px) { :root{--sidebar-w:230px;} .content{padding:28px 18px 48px;} .form-grid, .cols-2, .cols-3, .cols-4 { grid-template-columns:1fr; } .page-head { flex-direction:column; } }
@media (max-width: 720px) { .layout{grid-template-columns:1fr;} .sidebar{position:static; min-height:auto; display:flex; gap:8px; overflow-x:auto; padding:12px;} .sidebar-section-label,.sidebar-footer{display:none;} .nav-link{white-space:nowrap;margin:0;} .topbar{padding:0 14px;} .brand-mark{display:none;} .brand-title{max-width:48vw;} .userpill{display:none;} h1{font-size:28px;} .modal{padding:28px 12px;} }
.hero-card { width:min(880px, calc(100% - 32px)); margin:0 auto; text-align:center; background:rgba(255,255,255,.96); border:1px solid rgba(226,232,240,.96); border-radius:30px; padding:52px 38px; box-shadow:var(--shadow-lg); }
.hero-mark { width:64px; height:64px; border-radius:22px; display:grid; place-items:center; margin:0 auto 18px; background:linear-gradient(135deg,#2563eb,#0f172a); color:#fff; font-weight:950; letter-spacing:.08em; box-shadow:0 20px 40px rgba(37,99,235,.22); }
.hero-actions { display:flex; justify-content:center; gap:10px; margin-top:22px; }
.card-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:14px; }
.notice { border:1px solid #bfdbfe; background:#eff6ff; color:#1e40af; border-radius:14px; padding:12px 14px; margin:12px 0; font-weight:800; }
.success { border:1px solid #bbf7d0; background:#f0fdf4; color:#166534; border-radius:14px; padding:12px 14px; margin:12px 0; font-weight:800; }
@media (max-width: 980px) { .grid.cols-2 { grid-template-columns: 1fr; } }
