:root {
  --sidebar: #0f172a;
  --sidebar-text: #cbd5e1;
  --brand: #165dff;
  --panel: #ffffff;
  --bg: #f8fafc;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.login-body { background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%); }
a { color: var(--brand); text-decoration: none; }
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #0f172a 0%, #111827 100%); color: var(--sidebar-text); padding: 28px 20px; }
.brand h1 { margin: 0; color: #fff; }
.brand p { color: #94a3b8; margin: 8px 0 0; }
.sidebar nav { display: grid; gap: 10px; margin-top: 32px; }
.sidebar nav a { color: var(--sidebar-text); padding: 10px 14px; border-radius: 10px; }
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.07); }
.logout-box { display: grid; gap: 10px; margin-top: 28px; }
.admin-name { color: #94a3b8; font-size: 13px; }
.content { padding: 28px; }
.page-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 24px; }
.page-head h2 { margin: 0 0 8px; }
.page-head p { margin: 0; color: var(--muted); }
.grid { display: grid; gap: 24px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { margin-top: 8px; font-size: 26px; font-weight: 700; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.compact { margin-top: 16px; }
.form-grid label { display: grid; gap: 8px; }
.form-grid .full, .actions.full { grid-column: 1 / -1; }
input, select, textarea, .code-box { width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; font: inherit; background: #fff; }
textarea, .code-box { resize: vertical; min-height: 120px; }
.code-box { font-family: Consolas, "Courier New", monospace; min-height: 580px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.actions { display: flex; justify-content: flex-end; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.toolbar input, .toolbar select { max-width: 280px; }
.toolbar-actions { display: flex; justify-content: flex-end; gap: 12px; margin: 14px 0; }
.batch-toolbar { justify-content: flex-start; align-items: center; flex-wrap: wrap; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.checkbox-inline input,
.table-check input { width: 16px; height: 16px; margin: 0; }
.table-check { width: 56px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); }
.pager-links { display: flex; align-items: center; gap: 12px; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; border: 1px solid #dbeafe; background: #eff6ff; color: #1d4ed8; }
.status-pill.ok, .status-pill.published, .status-pill.succeeded { background: #ecfdf3; border-color: #bbf7d0; color: #15803d; }
.status-pill.pending, .status-pill.draft { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.status-pill.failed, .status-pill.paused { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.status-pill.running, .status-pill.ready { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.detail-list { display: grid; grid-template-columns: 140px 1fr; gap: 12px 16px; margin: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
pre { white-space: pre-wrap; margin: 0; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 520px); background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 32px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08); }
.login-card h1 { margin-top: 0; }
.alert { margin: 16px 0; padding: 12px 14px; border-radius: 12px; background: #fff1f2; color: #be123c; }
.alert.success { background: #ecfdf3; color: #166534; }
.row-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--brand); }
.danger-text { color: #be123c; }
.mini-form { margin-top: 12px; }
.simple-list { margin: 0; padding-left: 20px; line-height: 1.8; }
.muted { color: var(--muted); }
.logo-list { display: grid; gap: 10px; margin-bottom: 16px; }
.logo-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.logo-path { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
summary { cursor: pointer; color: var(--brand); }
.workspace-shell { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.workspace-sidebar { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; }
.workspace-sidebar-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 18px; }
.workspace-sidebar-head h2 { margin: 0 0 8px; }
.workspace-sidebar-head p { margin: 0; color: var(--muted); font-size: 13px; }
.project-list { display: grid; gap: 12px; }
.project-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.project-card.active { border-color: #bfdbfe; background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%); box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08); }
.project-card-main { display: grid; gap: 6px; color: inherit; }
.project-card-title { font-size: 16px; font-weight: 700; color: var(--text); }
.project-card-meta { color: var(--muted); font-size: 13px; }
.project-card-actions { display: flex; justify-content: flex-end; }
.workspace-main { display: grid; gap: 24px; min-width: 0; }
.workspace-toolbar { padding-bottom: 4px; }
.search-toolbar { margin-bottom: 0; }
.search-toolbar input { max-width: none; flex: 1; min-width: 220px; }
.tab-buttons { display: flex; gap: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tab-btn { padding: 10px 0; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; font: inherit; }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .grid.two, .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-shell { grid-template-columns: 1fr; }
  .workspace-sidebar { position: static; max-height: none; }
}
