/* Admin shell on top of /cdn/main.css (the base design system). Only what is specific to the admin. */
header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 14px var(--gutter); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--hairline); }
header .brand { display: flex; align-items: baseline; gap: 8px; }
header nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; font-size: 14px; }
header nav a { color: var(--muted); padding: 6px 10px; border-radius: var(--r-btn); }
header nav a.current { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline); }
header .who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13.5px; }
main { max-width: var(--wrap-narrow); margin: 0 auto; padding: 40px var(--gutter) 72px; }
main h1 { font-size: 28px; font-weight: 650; letter-spacing: -.03em; margin: 8px 0 6px; }
main > .body { margin: 0 0 24px; }
h2 { font-size: 17px; font-weight: 600; margin: 28px 0 10px; }
button, .btn-sm { font-family: inherit; font-size: 13.5px; font-weight: 500; padding: 8px 14px; border-radius: var(--r-btn);
  border: 1px solid var(--border); background: transparent; color: var(--ink); cursor: pointer; }
button:hover { border-color: var(--ink); }
button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); overflow: hidden; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--hairline-soft); vertical-align: top; font-size: 14px; }
th { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
tr:last-child td { border-bottom: 0; }
td code, .kind { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 0 0 20px; padding: 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); }
form.inline label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
td form.inline { padding: 8px 0 0; border: 0; margin: 0; background: none; }
input, select, textarea { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-input); background: var(--surface); color: var(--ink); }
textarea { font-family: var(--font-mono); font-size: 12.5px; min-height: 40px; }
.pill { display: inline-block; font-family: var(--font-mono); font-size: 11px; padding: 3px 9px; border-radius: var(--r-pill); }
.pill.up { color: var(--accent); background: var(--accent-tint); }
.pill.down { color: var(--alert); background: var(--alert-tint); }
.chip button { border: 0; padding: 0 0 0 6px; background: none; color: var(--faint); }
.secret { letter-spacing: .15em; color: var(--faint); }
.error { color: var(--alert); font-family: var(--font-mono); font-size: 12px; margin: 12px 0; }
.pill:not(.up):not(.down) { color: var(--muted); background: var(--hairline-soft); }
/* Controls inside tables follow the table's type size and never break into several lines. */
td button, td select, td input { font-size: 12.5px; padding: 6px 10px; white-space: nowrap; }
td select { max-width: 200px; }
td .kind { font-size: 11.5px; }
p code { font-family: var(--font-mono); font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--hairline); border-radius: 5px; padding: 1px 5px; }
/* One task per page: tabs inside a module or an item, crumbs above the title, the main action beside it. */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--hairline); margin: 14px 0 28px; }
.tabs a { padding: 10px 14px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.current { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 3px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 0; }
a.button { display: inline-block; font-size: 13.5px; font-weight: 500; padding: 8px 14px; border-radius: var(--r-btn); border: 1px solid var(--border); color: var(--ink); }
a.button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
form.stack { display: grid; gap: 16px; max-width: 640px; padding: 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); }
form.stack label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
form.stack .hint { font-size: 12.5px; color: var(--faint); font-weight: 400; }
form.stack .actions { display: flex; gap: 10px; }
.empty-state { padding: 28px 16px; color: var(--muted); }
.crumbs + .page-head, .crumbs + h1 { margin-top: 6px; }
main > form.stack, main > section > form.stack { margin-top: 20px; }
[hidden] { display: none !important; }
.load-more { margin-top: 12px; }   /* "Carregar mais" under a list that comes a page at a time */
.next-step { margin-top: 16px; }   /* the action that follows what the page just showed */
.frame.narrow { max-width: 640px; }   /* key / value facts, kept to a readable width */
header nav .more { position: relative; }
header nav .more summary { list-style: none; cursor: pointer; color: var(--muted); padding: 6px 10px; border-radius: var(--r-btn); }
header nav .more summary::-webkit-details-marker { display: none; }
header nav .more summary::after { content: " ▾"; font-size: 11px; }
header nav .more summary.current { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline); }
header nav .more > div { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 180px; display: grid; padding: 6px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); box-shadow: 0 12px 32px rgb(0 0 0 / .1); }
header nav .more > div a { padding: 8px 10px; border-radius: var(--r-btn); color: var(--ink); }
header nav .more > div a:hover, header nav .more > div a.current { background: var(--hairline-soft); }
header .fold { display: none; }
@media (max-width: 900px) {
  header { gap: 12px; }
  header .fold { display: block; margin-left: auto; order: 2; padding: 6px 12px; font-size: 18px; line-height: 1; }
  header .who { order: 3; }
  header nav { order: 4; flex-basis: 100%; display: none; flex-direction: column; align-items: stretch; }
  header.open nav { display: flex; }
  header nav .more > div { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; }
}
