:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --panel: #fff;
  --panel-2: #f8fafc;
  --text: #101828;
  --muted: #667085;
  --line: #d8dee8;
  --brand: #116149;
  --brand-2: #0e4f3c;
  --blue: #2357c6;
  --amber: #a16207;
  --danger: #b42318;
  --ok: #027a48;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; }
button, input, select, textarea { font: inherit; }
button { white-space: nowrap; }
.app-shell { display: grid; grid-template-columns: 292px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 26px; padding: 24px; background: #16202e; color: #fff; }
.brand-block { display: block; padding-bottom: 4px; }
.brand-block h1, .topbar h2, .dialog-card h2 {
  margin: 0;
  line-height: 1.22;
}

.brand-block h1 {
  padding-top: 2px;
  max-width: 220px;
}
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.sidebar .eyebrow { color: #a7b4c7; }
.tabs { display: grid; gap: 7px; }
.tab { width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 12px 14px; background: transparent; color: #dbe4ef; text-align: left; cursor: pointer; }
.tab.active, .tab:hover { border-color: #36506e; background: #223149; }
.server-box { margin-top: auto; border: 1px solid #36506e; border-radius: 8px; padding: 16px; background: #1d2a3d; }
.server-box span, .server-box small { display: block; color: #a7b4c7; }
.server-box strong { display: block; margin: 7px 0; color: #8ee3bd; }
.creator { margin: -14px 0 0; color: #a7b4c7; font-size: 12px; }
.workspace { min-width: 0; padding: 26px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding-top: 2px; }
.top-actions, .actions, .inline-actions { display: flex; gap: 8px; align-items: center; }
.primary-button, .ghost-button, .danger-button { min-height: 40px; border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer; font-weight: 700; }
.primary-button { background: var(--brand); color: #fff; }
.primary-button:hover { background: var(--brand-2); }
.ghost-button { background: #e9eef5; color: var(--text); }
.danger-button { background: #fee4e2; color: var(--danger); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric, .panel, .table-card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.metric { padding: 16px; }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 8px; font-size: 27px; }
.board { display: grid; gap: 14px; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr .9fr; gap: 14px; }
.panel { padding: 18px; min-width: 0; }
.panel-header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel h3 { margin: 0; font-size: 18px; }
.panel p { color: var(--muted); line-height: 1.45; }
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stage { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--panel-2); }
.stage span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.stage strong { display: block; margin-top: 7px; font-size: 22px; }
.list { display: grid; gap: 10px; }
.list-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--panel-2); }
.list-item strong, .list-item span { display: block; }
.list-item span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.table-card { overflow: hidden; }
.table-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.search-box { max-width: 320px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: #f8fafc; font-size: 12px; text-transform: uppercase; }
td { font-size: 14px; }
.muted { color: var(--muted); }
.badge { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 4px 9px; background: #e8f1ff; color: var(--blue); font-size: 12px; font-weight: 700; }
.badge.ok { background: #dcfae6; color: var(--ok); }
.badge.warn { background: #fef0c7; color: var(--amber); }
.badge.danger { background: #fee4e2; color: var(--danger); }
dialog { width: min(680px, calc(100vw - 28px)); border: 0; border-radius: 8px; padding: 0; }
dialog::backdrop { background: rgba(16, 24, 40, .55); }
.dialog-card { padding: 22px; }
.form-grid { display: grid; gap: 14px; margin: 20px 0; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; color: var(--text); background: #fff; }
textarea { min-height: 96px; resize: vertical; }
menu { display: flex; justify-content: flex-end; gap: 10px; margin: 0; padding: 0; }

@media (max-width: 980px) {
  .app-shell, .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .metrics, .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .metrics, .pipeline { grid-template-columns: 1fr; }
  .workspace, .sidebar { padding: 18px; }
  .topbar, .table-toolbar { align-items: flex-start; flex-direction: column; }
  .table-card { overflow-x: auto; }
}
