/**
 * Workbench - Komponenter
 * Knapper, felter, segmentvælger, bannere, bjælker, paneler og tabeller, som flere sider bruger.
 */

/* -------- Knapper -------- */
.btn {
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }

/* -------- Felter -------- */
input[type=text], input[type=search], input[type=password], select, textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 8px; background-color: var(--surface);
  color: var(--ink); font-size: 13px; outline: none;
}
input[type=text], input[type=search], input[type=password], select { height: 36px; padding: 0 12px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px !important; text-overflow: ellipsis;
  background-repeat: no-repeat; background-position: right 11px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%23888' stroke-width='1.5'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
}
select:hover { border-color: var(--dim); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 90px; padding: 10px 12px; resize: vertical; font-size: 14px; line-height: 1.55; }
label.f {
  display: block; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin: 14px 0 8px;
}

/* -------- Segmentvælger -------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); }
.seg button { height: 28px; min-width: 38px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--surface); }
.seg.mono button { height: 26px; border-radius: 5px; font-family: var(--mono); font-weight: 500; }
.seg.mono button.on[data-priority="P1"] { background: var(--accent); color: var(--accent-ink); }

/* -------- Bannere og bjælker -------- */
.banner {
  background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--radius); padding: 10px 14px; font-size: 13px;
}
.banner.error { background: var(--crit-bg); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 30%, transparent); }
.page-error { margin-bottom: 16px; }
.bar { display: inline-block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--moss); }

/* -------- Sidehoved, paneler og tabeller -------- */
.page-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.page-head h1 { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.sub { font-size: 14px; color: var(--muted); max-width: 70ch; text-wrap: pretty; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.panel.muted { background: transparent; border-style: dashed; }
.panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel.muted .panel-head { border-bottom: 0; }
.panel-head h2 { font-size: 16px; }
.panel-head .count { font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 1px 6px; border-radius: 5px; background: var(--surface-2); }
.panel-head .note { font-size: 12.5px; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 9px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.dim td { opacity: .55; }

.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--moss); color: var(--surface); font-size: 11.5px; font-weight: 700;
}
.mark, swp-brand-mark {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  background: var(--project-color, linear-gradient(135deg, #1B98AE, #157A8D)); color: #fff;
  font-style: normal; font-weight: 700; font-size: 12.5px;
}

/* Markdown (tegnet på serveren): skuffen, dokumenter og repos */
.md { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md pre, .md table, .md blockquote { margin: 0 0 8px; }
.md ul, .md ol { padding-left: 20px; }
.md li + li { margin-top: 2px; }
.md li.task-list-item { list-style: none; margin-left: -18px; }
.md h1, .md h2, .md h3, .md h4 { margin: 12px 0 6px; font-size: 14px; color: var(--ink); }
.md h1 { font-size: 16px; }
.md a { color: var(--accent); }
.md code { font-family: var(--mono); font-size: 12px; padding: 1px 4px; border-radius: 4px; background: var(--hover); }
.md pre { padding: 10px 12px; border-radius: 8px; background: var(--hover); overflow-x: auto; }
.md pre code { padding: 0; background: none; }
.md blockquote { padding-left: 10px; border-left: 3px solid var(--line-2); color: var(--muted); }
.md table { border-collapse: collapse; font-size: 12.5px; }
.md th, .md td { padding: 4px 8px; border: 1px solid var(--line); text-align: left; }
