/* Central do Dono
   Paleta (herdada do painel v1): azul-tinta (estrutura), latão (ação e destaque), papel frio (fundo).
   Tipografia: serifada clássica para títulos, sans do sistema para leitura. Base 17px.
   Regra do painel: listas e páginas, nunca grade de cartões. */

:root {
  --ink: #13233B;
  --ink-2: #1E3352;
  --ink-3: #2C4568;
  --paper: #F5F6F8;
  --surface: #FFFFFF;
  --line: #DFE3E9;
  --line-soft: #ECEFF3;
  --text: #18202C;
  --muted: #586273;
  --faint: #8A93A3;
  --brass: #B8893A;
  --brass-hi: #C9A15A;
  --brass-soft: #F6EEDF;
  --ok: #2E7A57;
  --ok-soft: #E5F2EB;
  --bad: #AF3E2C;
  --bad-soft: #F8E7E3;
  --warn: #946210;
  --warn-soft: #FBF1DC;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --wrap: 1180px;
  --focus: 0 0 0 3px rgba(184, 137, 58, .45);
  --shadow-pop: 0 18px 50px rgba(19, 35, 59, .22), 0 2px 6px rgba(19, 35, 59, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.55 var(--sans);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); }
kbd { font: 12px/1 var(--sans); padding: 4px 6px; border-radius: 4px; border: 1px solid currentColor; opacity: .6; }

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: .01em;
}
.brand-mark, .login-mark {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 8px; background: var(--brass-hi); color: var(--ink);
  font-family: var(--serif); font-weight: 700; font-size: 21px; line-height: 1;
}
.login-mark { width: 52px; height: 52px; font-size: 32px; border-radius: 12px; background: var(--ink); color: var(--brass-hi); margin-bottom: 14px; }

/* ---------------------------------------------------------------- botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 16px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-3); }
.btn-accent { background: var(--brass-hi); color: var(--ink); }
.btn-accent:hover { background: #D5B070; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-open { background: var(--surface); color: var(--ink); border-color: #C3CAD5; min-width: 104px; }
.btn-open:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #962F20; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* ---------------------------------------------------------------- entrada */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    linear-gradient(180deg, var(--ink) 0, var(--ink) 46%, var(--paper) 46%);
}
.login-panel {
  width: 100%; max-width: 480px; background: var(--surface);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden;
}
.login-brand {
  padding: 40px 36px 30px; text-align: center; border-bottom: 1px solid var(--line-soft);
}
.login-brand .wordmark { display: block; font-size: 36px; color: var(--ink); }
.cmd { display: block; font-family: ui-monospace, Consolas, monospace; font-size: 14.5px; padding: 12px 14px; background: var(--ink); color: #E8EDF4; border-radius: var(--r-sm); word-break: break-all; }
.login-sub { display: block; margin-top: 8px; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 18px; }
.login-form { padding: 28px 36px 8px; display: grid; gap: 18px; }
.login-foot { margin: 0; padding: 14px 36px 26px; color: var(--faint); font-size: 14px; text-align: center; }
#loginKey { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; font-size: 16px; }

/* ---------------------------------------------------------------- campos */
.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: 16px; }
.field-label .opt { color: var(--faint); font-weight: 400; }
.field-hint { color: var(--muted); font-size: 14.5px; }
.field-error { color: var(--bad); font-size: 14.5px; font-weight: 600; }
input[type=text], input[type=password], input[type=url], input[type=tel], input[type=search], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid #C9D0DA; border-radius: var(--r-sm); background: #fff; font-size: 17px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: var(--focus); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.field.is-valid input { border-color: var(--ok); }
input[readonly] { background: var(--paper); color: var(--muted); }
.input-wrap { position: relative; display: flex; }
.input-wrap input { padding-right: 96px; }
.input-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 36px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--line); background: var(--paper); font-size: 14.5px; font-weight: 600;
}
.input-btn:hover { border-color: var(--ink); }
.form-error { margin: 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: 15.5px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.counter { justify-self: end; color: var(--faint); font-size: 13.5px; margin-top: -2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------------------------------------------------------------- topo */
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.top-bar {
  max-width: var(--wrap); margin: 0 auto; padding: 16px 24px 10px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand .wordmark { font-size: 25px; color: #fff; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 14px; min-width: 230px;
  background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--r-sm); color: #C9D2DF;
}
.search-trigger:hover { border-color: #4A6187; color: #fff; }
.search-label { margin-right: auto; }
.top-icon {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 12px;
  background: transparent; border: 1px solid var(--ink-3); border-radius: var(--r-sm); color: #DCE3EC; justify-content: center;
}
.top-icon:hover { background: var(--ink-2); color: #fff; }
.top-icon-label { font-weight: 600; font-size: 15.5px; }

.menu-principal {
  max-width: var(--wrap); margin: 0 auto; padding: 0 12px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.menu-principal::-webkit-scrollbar { display: none; }
.menu-item {
  position: relative; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 12px 12px 14px; color: #B9C4D3; text-decoration: none; font-size: 16.5px; font-weight: 500;
  border-radius: 6px 6px 0 0;
}
.menu-item:hover { color: #fff; background: var(--ink-2); }
.menu-item svg { width: 18px; height: 18px; }
.menu-item .caret { width: 14px; height: 14px; opacity: .6; }
.menu-item[aria-current="page"] { color: #fff; font-weight: 600; }
.menu-item[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; background: var(--brass-hi); border-radius: 3px 3px 0 0;
}

/* ---------------------------------------------------------------- área principal */
.view { max-width: var(--wrap); margin: 0 auto; padding: 36px 24px 80px; outline: none; }

/* seção com submenu lateral */
.secao { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; align-items: start; }
.submenu { position: sticky; top: 132px; display: grid; gap: 2px; }
.submenu-titulo { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink); text-decoration: none; padding: 0 12px 10px; }
.submenu-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--text); text-decoration: none; font-size: 16.5px;
}
.submenu-item:hover { background: var(--line-soft); }
.submenu-item .n { margin-left: auto; font-size: 13.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.submenu-item[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: inset 3px 0 0 var(--brass), 0 1px 2px rgba(19, 35, 59, .08); }
.submenu-vazio { padding: 10px 12px; color: var(--faint); font-size: 15px; }
.submenu-acao { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; color: var(--muted); font-size: 15px; text-decoration: none; border-top: 1px solid var(--line); }
.submenu-acao svg { width: 16px; height: 16px; }
.submenu-acao:hover { color: var(--ink); }
.conteudo { min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head-text { margin-right: auto; min-width: 0; }
.page-title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 40px; line-height: 1.1; color: var(--ink); letter-spacing: -.005em; }
.page-lede { margin: 8px 0 0; color: var(--muted); font-size: 18px; max-width: 62ch; }
.section-title { margin: 40px 0 12px; font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink); display: flex; align-items: baseline; gap: 12px; }
.section-title small { font-family: var(--sans); font-size: 14.5px; color: var(--faint); font-weight: 400; }

.toolbar { display: flex; gap: 12px; margin-bottom: 14px; align-items: center; }
.toolbar .filter { flex: 1; position: relative; }
.toolbar .filter svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.toolbar .filter input { padding-left: 44px; }
.toolbar select { width: auto; min-width: 200px; }

/* ---------------------------------------------------------------- lista de itens */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 150px auto; gap: 18px; align-items: center;
  padding: 16px 18px; border-top: 1px solid var(--line-soft);
}
.row:first-child { border-top: 0; }
.row:hover { background: #FAFBFC; }
.mono {
  width: 52px; height: 52px; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: .02em;
}
.mono svg { width: 24px; height: 24px; }
.hue-0 { background: #E6ECF5; color: #23426E; }
.hue-1 { background: #F3EADA; color: #7E5A1C; }
.hue-2 { background: #E3F0EA; color: #245E45; }
.hue-3 { background: #F2E4E1; color: #8A3526; }
.hue-4 { background: #ECE6F3; color: #4E3A78; }
.hue-5 { background: #E2EEF1; color: #1F5A66; }
.hue-6 { background: #EEEDE4; color: #5A5531; }
.hue-7 { background: #EAE8EC; color: #45404F; }
.row-main { min-width: 0; }
.row-title { display: flex; align-items: center; gap: 8px; }
.row-name {
  background: none; border: 0; padding: 0; text-align: left; color: var(--ink);
  font-size: 19.5px; font-weight: 650; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-name:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--brass); }
.star { color: var(--brass); width: 17px; height: 17px; fill: var(--brass); stroke: var(--brass); }
.row-desc { color: var(--muted); font-size: 16px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; font-size: 14.5px; color: var(--faint); }
.row-dest { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tag { padding: 1px 8px; border-radius: 4px; background: var(--paper); border: 1px solid var(--line-soft); color: var(--muted); font-size: 13.5px; }
.row-actions { display: flex; align-items: center; gap: 6px; }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.status.online { color: var(--ok); } .status.online .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status.offline, .status.error { color: var(--bad); } .status.offline .dot, .status.error .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.status.kind { color: var(--faint); } .status.kind .dot { background: transparent; border: 1.5px solid var(--line); }

/* índice de categorias na página inicial */
.index { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.index td { padding: 14px 18px; border-top: 1px solid var(--line-soft); font-size: 17px; }
.index tr:first-child td { border-top: 0; }
.index tr { cursor: pointer; }
.index tr:hover td { background: #FAFBFC; }
.index .ix-name { font-weight: 650; color: var(--ink); width: 28%; }
.index .ix-name a { text-decoration: none; }
.index .ix-desc { color: var(--muted); }
.index .ix-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.summary { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 14px; font-size: 16.5px; color: var(--muted); }
.summary b { color: var(--ink); font-size: 20px; font-family: var(--serif); margin-right: 4px; }
.summary b.bad { color: var(--bad); }
.summary { margin: -6px 0 6px; }

/* estados vazios */
.empty { background: var(--surface); border: 1px dashed #C9D0DA; border-radius: var(--r); padding: 40px 32px; text-align: center; }
.empty h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 24px; color: var(--ink); }
.empty p { margin: 0 auto 22px; color: var(--muted); max-width: 54ch; }
.empty .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hint-line { color: var(--muted); font-size: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin: 0; }

/* ---------------------------------------------------------------- camadas: modal, gaveta, menu */
.backdrop { position: fixed; inset: 0; background: rgba(13, 24, 41, .5); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s ease-out; }
.modal {
  width: 100%; max-width: 680px; max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); animation: rise .18s ease-out;
}
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--ink); margin-right: auto; }
.modal-step { color: var(--faint); font-size: 14.5px; }
.modal-body { padding: 22px 24px; overflow-y: auto; display: grid; gap: 18px; align-content: start; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line-soft); background: #FBFBFC; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.modal-foot .spacer { margin-right: auto; }

.drawer-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(13, 24, 41, .35); animation: fade .15s ease-out; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface);
  display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: slide .2s ease-out;
}
.drawer .modal-body { flex: 1; }

.menu {
  position: fixed; z-index: 60; min-width: 230px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px; animation: fade .1s ease-out;
}
.menu button {
  display: flex; width: 100%; align-items: center; gap: 12px; padding: 11px 12px; border: 0; background: none;
  border-radius: var(--r-sm); text-align: left; font-size: 16px;
}
.menu button:hover, .menu button:focus-visible { background: var(--paper); box-shadow: none; }
.menu button svg { color: var(--muted); width: 18px; height: 18px; }
.menu .danger { color: var(--bad); } .menu .danger svg { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 0; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

/* ---------------------------------------------------------------- assistente de adicionar */
.choices { display: grid; gap: 10px; }
.choice {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: center; text-align: left;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.choice:hover { border-color: var(--ink); background: #FAFBFC; }
.choice .mono { width: 48px; height: 48px; }
.choice strong { display: block; font-size: 18px; color: var(--ink); }
.choice span { color: var(--muted); font-size: 15.5px; }
.choice .go { color: var(--faint); }

.pathbar { display: flex; gap: 8px; }
.pathbar input { font-family: ui-monospace, Consolas, monospace; font-size: 15.5px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; font-size: 15px; color: var(--muted); align-items: center; }
.crumbs button { background: none; border: 0; padding: 2px 4px; border-radius: 4px; color: var(--ink-3); font-weight: 600; }
.crumbs button:hover { background: var(--line-soft); }
.dirlist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); max-height: 46vh; overflow-y: auto; }
.dirlist li + li { border-top: 1px solid var(--line-soft); }
.dirlist button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: none; border: 0; text-align: left; font-size: 16.5px;
}
.dirlist button:hover { background: var(--paper); }
.dirlist .ico { color: var(--brass); }
.dirlist .file .ico { color: var(--faint); }
.dirlist .marker { margin-left: auto; font-size: 13px; padding: 2px 8px; border-radius: 4px; background: var(--brass-soft); color: #7E5A1C; font-weight: 600; }
.dirlist .muted { color: var(--faint); padding: 14px 16px; font-size: 15px; }

.findings { list-style: none; margin: 0; padding: 14px 16px; background: var(--paper); border-radius: var(--r); display: grid; gap: 8px; }
.findings li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 15.5px; line-height: 1.45; }
.findings .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; margin-top: 1px; }
.findings .ok .ic { background: var(--ok-soft); color: var(--ok); }
.findings .warn .ic { background: var(--warn-soft); color: var(--warn); }
.findings .info .ic { background: #E6ECF5; color: #23426E; }
.findings-title { margin: 0 0 -8px; font-family: var(--serif); font-size: 19px; color: var(--ink); }

.notice { padding: 12px 14px; border-radius: var(--r-sm); font-size: 15.5px; display: flex; gap: 10px; align-items: flex-start; }
.notice.ok { background: var(--ok-soft); color: #1F5A40; }
.notice.warn { background: var(--warn-soft); color: #6F4A0B; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.info { background: #EDF1F7; color: var(--ink-3); }
.notice b { font-weight: 650; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; background: var(--paper); gap: 3px; }
.seg label { padding: 8px 14px; border-radius: 4px; font-size: 15.5px; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); box-shadow: 0 1px 2px rgba(19, 35, 59, .12); font-weight: 650; color: var(--ink); }
.seg label:has(input:focus-visible) { box-shadow: var(--focus); }

.loading { display: flex; align-items: center; gap: 14px; padding: 30px 0; color: var(--muted); justify-content: center; font-size: 17px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brass); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.keybox {
  font-family: ui-monospace, Consolas, monospace; font-size: 19px; letter-spacing: .04em; padding: 16px; text-align: center;
  border: 1px solid var(--brass); background: var(--brass-soft); border-radius: var(--r-sm); color: var(--ink); word-break: break-all;
}
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.ok-t { color: var(--ok); font-weight: 600; } .bad-t { color: var(--bad); font-weight: 600; }

.cat-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cat-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); }
.cat-row .field-error { grid-column: 1 / -1; }
.cat-row-actions { display: flex; gap: 2px; }

/* ---------------------------------------------------------------- busca rápida */
.palette-wrap { align-items: flex-start; padding-top: 12vh; }
.palette { width: 100%; max-width: 640px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; animation: rise .15s ease-out; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line-soft); }
.palette-input svg { color: var(--faint); }
.palette-input input { border: 0; box-shadow: none !important; min-height: 62px; font-size: 19px; padding: 0; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.palette-list li { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; }
.palette-list li[aria-selected="true"] { background: var(--paper); box-shadow: inset 3px 0 0 var(--brass); }
.palette-list .mono { width: 38px; height: 38px; font-size: 16px; }
.palette-list .p-main { min-width: 0; flex: 1; }
.palette-list .p-name { font-weight: 650; font-size: 17px; }
.palette-list .p-sub { color: var(--faint); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-list .p-cat { color: var(--muted); font-size: 14px; }
.palette-group { padding: 10px 12px 4px; color: var(--faint); font-size: 13.5px; cursor: default !important; }
.palette-foot { padding: 10px 18px; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 13.5px; display: flex; gap: 16px; }

/* ---------------------------------------------------------------- guia */
.guide-hello { display: flex; gap: 14px; align-items: flex-start; }
.guide-hello .mono { background: var(--ink); color: var(--brass-hi); }
.guide-hello p { margin: 0; font-size: 16.5px; }
.guide-hello p strong { font-family: var(--serif); font-size: 19px; display: block; color: var(--ink); }
.guide-topics { display: grid; gap: 8px; }
.topic { border: 1px solid var(--line); border-radius: var(--r); }
.topic summary { list-style: none; padding: 14px 16px; font-weight: 650; font-size: 16.5px; color: var(--ink); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.topic summary::-webkit-details-marker { display: none; }
.topic summary::after { content: "+"; margin-left: auto; color: var(--faint); font-size: 20px; font-weight: 400; }
.topic[open] summary::after { content: "−"; }
.topic[open] { border-color: #C3CAD5; }
.topic.match { border-color: var(--brass); background: #FFFDF8; }
.topic ol { margin: 0; padding: 0 18px 4px 40px; display: grid; gap: 8px; font-size: 16px; }
.topic code { font-family: ui-monospace, Consolas, monospace; font-size: 14px; background: var(--paper); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.topic .topic-actions { padding: 12px 16px 16px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- tour */
.tour-spot {
  position: fixed; z-index: 80; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--brass-hi), 0 0 0 9999px rgba(13, 24, 41, .62);
  transition: all .25s ease;
}
.tour-block { position: fixed; inset: 0; z-index: 79; }
.tour-pop {
  position: fixed; z-index: 81; width: min(380px, calc(100vw - 32px)); background: var(--surface);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 20px 22px 16px; transition: top .25s ease, left .25s ease;
}
.tour-pop h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; color: var(--ink); }
.tour-pop p { margin: 0 0 16px; font-size: 16.5px; color: var(--text); }
.tour-nav { display: flex; align-items: center; gap: 8px; }
.tour-count { margin-right: auto; color: var(--faint); font-size: 14.5px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- avisos */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(460px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 14px 18px; border-radius: var(--r); box-shadow: var(--shadow-pop); font-size: 16px; display: flex; gap: 10px; align-items: center; animation: rise .18s ease-out; }
.toast.bad { background: var(--bad); }
.toast svg { color: var(--brass-hi); }

/* ---------------------------------------------------------------- arquivos (gaveta) */
.files { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.files li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.files li:first-child { border-top: 0; }
.files .f-main { min-width: 0; flex: 1; }
.files .f-name { font-weight: 600; font-size: 16px; word-break: break-word; }
.files .f-sub { color: var(--faint); font-size: 14px; }
.files .ico { color: var(--faint); }
.files .dir .ico { color: var(--brass); }
.files a.btn { text-decoration: none; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 900px) {
  .search-trigger { min-width: 0; }
  .search-trigger kbd, .search-label { display: none; }
  .top-icon-label { display: none; }
  .row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .row .row-status { grid-column: 2; grid-row: 2; margin-top: -6px; }
  .row .row-actions { grid-row: 1 / span 2; grid-column: 3; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .top-bar { padding: 12px 14px 6px; gap: 8px; }
  .brand .wordmark { font-size: 21px; }
  .brand-mark { width: 30px; height: 30px; font-size: 18px; }
  .view { padding: 26px 14px 80px; }
  .page-title { font-size: 32px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar select { width: 100%; }
  .row { gap: 12px; padding: 14px; grid-template-columns: 44px minmax(0, 1fr) auto; }
  .mono { width: 44px; height: 44px; font-size: 18px; }
  .row-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .btn-open { min-width: 0; padding: 0 12px; }
  .row .row-actions { flex-direction: column-reverse; align-items: flex-end; }
  .backdrop { padding: 0; align-items: stretch; }
  .modal { max-height: 100vh; height: 100%; border-radius: 0; max-width: none; }
  .modal-foot { border-radius: 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .grid-2 { grid-template-columns: 1fr; }
  .cat-row { grid-template-columns: 1fr auto; }
  .cat-row .cat-desc { grid-column: 1 / -1; grid-row: 2; }
  .index .ix-desc { display: none; }
  .palette-wrap { padding-top: 0; }
  .palette { border-radius: 0; max-width: none; min-height: 100%; }
  .tour-pop { left: 16px !important; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); top: auto !important; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* complementos */
.form-stack { display: grid; gap: 18px; }
.cat-manage { background: none; border: 0; }
.confirm-text { margin: 0; font-size: 17px; }
#guideQ { margin-top: 2px; }
.notice .spinner { width: 18px; height: 18px; }
.notice svg { margin-top: 1px; }

/* ================================================================ Central do Dono: peças novas */
.mt { margin-top: 14px; }
.hint { color: var(--faint); font-size: 15px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .86em; background: var(--line-soft); padding: 1px 6px; border-radius: 4px; word-break: break-word; }
.hint-line a, .em-breve a, .page-lede a { color: var(--ink-3); font-weight: 600; text-underline-offset: 3px; }
.hint-line .spinner { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.section-title small { margin-left: auto; text-align: right; }

/* "chega na etapa…" */
.em-breve { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brass-hi); border-radius: var(--r); padding: 22px 26px; }
.em-breve-selo { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 16px; }
.em-breve-selo b { color: var(--ink); }
.selo { display: inline-grid; place-items: center; min-width: 40px; height: 28px; padding: 0 8px; border-radius: 6px; background: var(--ink); color: var(--brass-hi); font-weight: 700; font-size: 14px; letter-spacing: .03em; }
.em-breve-titulo { margin: 18px 0 8px; font-family: var(--serif); font-size: 20px; color: var(--ink); }
.em-breve-lista { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--text); }
.em-breve-depende { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 16px; }
.em-breve-depende b { color: var(--ink); }

/* etapas */
.etapas { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.etapa { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.etapa:first-child { border-top: 0; }
.etapa-id { display: grid; place-items: center; width: 44px; height: 32px; border-radius: 6px; font-weight: 700; font-size: 15px; background: var(--line-soft); color: var(--muted); }
.etapa-nome { font-weight: 650; color: var(--ink); }
.etapa-faz { color: var(--muted); font-size: 15.5px; }
.etapa-sit { font-size: 14.5px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.etapa.feita .etapa-id { background: var(--ok-soft); color: var(--ok); }
.etapa.feita .etapa-sit { color: var(--ok); }
.etapa.proxima .etapa-id { background: var(--ink); color: var(--brass-hi); }
.etapa.proxima .etapa-sit { color: var(--ink); }
.etapa.futura .etapa-nome { color: var(--muted); }

/* alertas do Início */
.tudo-certo { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; background: var(--ok-soft); border-radius: var(--r); color: #1F5A40; }
.tudo-certo svg { color: var(--ok); width: 24px; height: 24px; stroke-width: 2.4; margin-top: 2px; }
.tudo-certo b { display: block; font-size: 17.5px; }
.tudo-certo span { font-size: 15.5px; }
.alertas { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.alerta { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.alerta:first-child { border-top: 0; }
.alerta-nivel { font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 4px; text-align: center; }
.alerta.atencao .alerta-nivel { background: var(--warn-soft); color: var(--warn); }
.alerta.critico .alerta-nivel { background: var(--bad); color: #fff; }
.alerta-titulo { font-weight: 650; color: var(--ink); }
.alerta-detalhe { color: var(--muted); font-size: 15.5px; }

/* tabelas em lista (sistemas, pastas, abas) */
.tabela-lista { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tabela-lista th { text-align: left; font-weight: 600; font-size: 14.5px; color: var(--muted); padding: 12px 18px; border-bottom: 1px solid var(--line); background: #FBFBFC; }
.tabela-lista td { padding: 14px 18px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.tabela-lista tr[data-href] { cursor: pointer; }
.tabela-lista tr[data-href]:hover td { background: #FAFBFC; }
.tl-nome { font-weight: 650; color: var(--ink); }
.tl-nome a { text-decoration: none; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.pendente { background: var(--line-soft); color: var(--muted); }

/* pares rótulo/valor */
.kv { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.kv > div { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; padding: 12px 18px; border-top: 1px solid var(--line-soft); align-items: baseline; }
.kv > div:first-child { border-top: 0; }
.kv span { color: var(--muted); font-size: 15.5px; }
.kv b { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kv .ok-i { color: var(--ok); width: 18px; height: 18px; stroke-width: 2.6; }

/* medidores (disco, memória, processador) */
.medidas { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.medidas li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--line-soft); }
.medidas li:first-child { border-top: 0; }
.medida-nome { font-weight: 650; color: var(--ink); }
.medida-valor { font-size: 17px; }
.medidor { display: grid; gap: 6px; }
.medidor-barra { height: 10px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.medidor-barra span { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--ok); transition: width .4s ease; }
.medidor.atencao .medidor-barra span { background: var(--brass); }
.medidor.critico .medidor-barra span { background: var(--bad); }
.medidor-rot { color: var(--muted); font-size: 15px; }

.busca-codigo { max-width: 420px; margin-bottom: 18px; }
.busca-codigo input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.busca-codigo input:disabled { background: var(--line-soft); }
.passos { margin: 0; padding: 16px 20px 16px 42px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: grid; gap: 8px; }
.crumbs a { color: var(--ink-3); font-weight: 600; text-decoration: none; padding: 2px 4px; border-radius: 4px; }
.crumbs a:hover { background: var(--line-soft); }
.crumbs { margin-bottom: 12px; }
.files a.f-name { color: var(--ink); text-decoration: none; }
#guideQ { margin-bottom: 12px; }
#guideAnswer:not(:empty) { margin-bottom: 12px; }

@media (max-width: 900px) {
  .secao { grid-template-columns: 1fr; gap: 18px; }
  .submenu { position: static; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .submenu::-webkit-scrollbar { display: none; }
  .submenu-titulo, .submenu-acao { display: none; }
  .submenu-item { flex-shrink: 0; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; font-size: 15.5px; }
  .submenu-item[aria-current="page"] { background: var(--ink); color: #fff; box-shadow: none; }
  .submenu-item[aria-current="page"] .n { color: var(--brass-hi); }
}
@media (max-width: 640px) {
  .menu-item { padding: 10px 10px 12px; font-size: 15.5px; }
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
  .medidas li { grid-template-columns: 1fr; gap: 6px; }
  .alerta { grid-template-columns: 1fr; gap: 6px; }
  .alerta-nivel { justify-self: start; }
  .etapa { grid-template-columns: 44px minmax(0, 1fr); }
  .etapa-sit { grid-column: 2; }
  .tabela-lista th, .tabela-lista td { padding: 12px; }
  .section-title { flex-wrap: wrap; }
  .section-title small { margin-left: 0; text-align: left; }
  .em-breve { padding: 18px; }
}
