/* =========================================================
   Portal ONmnIA — design tokens + componentes
   ========================================================= */
:root {
  --brand-600: #4f46e5;
  --brand-500: #6366f1;
  --brand-50: #eef2ff;
  --green-600: #059669;
  --green-50: #ecfdf5;
  --amber-600: #d97706;
  --amber-50: #fffbeb;
  --red-600: #dc2626;
  --red-50: #fef2f2;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e3e6ef;
  --text: #171a2b;
  --text-muted: #636a82;
  --sidebar-bg: linear-gradient(180deg, #052e1f 0%, #06402b 55%, #065f46 100%);
  --sidebar-text: #c6e9da;
  --sidebar-active: rgba(52, 211, 153, .18);
  --sidebar-accent: #6ee7b7;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(17, 20, 42, .06);
  --shadow: 0 4px 16px rgba(17, 20, 42, .08);
  --shadow-lg: 0 24px 48px rgba(17, 20, 42, .18);
  --focus: 0 0 0 3px rgba(99, 102, 241, .35);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 256px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-fundo="claro"]) {
    --bg: #0d0f1c;
    --surface: #161a2e;
    --surface-2: #1d2238;
    --border: #2a3050;
    --text: #e7e9f4;
    --text-muted: #9aa1bd;
    --sidebar-bg: linear-gradient(180deg, #03170f 0%, #052e1f 100%);
    --brand-50: rgba(99, 102, 241, .16);
    --green-50: rgba(5, 150, 105, .16);
    --amber-50: rgba(217, 119, 6, .16);
    --red-50: rgba(220, 38, 38, .16);
    --shadow: 0 4px 16px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-fundo="escuro"] {
    --bg: #0d0f1c;
    --surface: #161a2e;
    --surface-2: #1d2238;
    --border: #2a3050;
    --text: #e7e9f4;
    --text-muted: #9aa1bd;
    --sidebar-bg: linear-gradient(180deg, #03170f 0%, #052e1f 100%);
    --brand-50: rgba(99, 102, 241, .16);
    --green-50: rgba(5, 150, 105, .16);
    --amber-50: rgba(217, 119, 6, .16);
    --red-50: rgba(220, 38, 38, .16);
    --shadow: 0 4px 16px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--brand-600); }
img { max-width: 100%; display: block; }
.muted { color: var(--text-muted); }
.icon { width: 18px; height: 18px; flex: none; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--brand-600); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.btn--primary { background: var(--brand-600); color: #fff; }
.btn--primary:hover { background: var(--brand-500); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger-ghost { background: transparent; color: var(--red-600); border-color: var(--border); }
.btn--danger-ghost:hover { background: var(--red-50); border-color: var(--red-600); }
.btn--danger { background: var(--red-600); color: #fff; }
.btn--icon { width: 40px; padding: 0; background: transparent; color: inherit; }
.btn--icon:hover { background: var(--surface-2); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn--sm.btn--danger-ghost { width: 34px; padding: 0; }
.btn--lg { height: 48px; font-size: 16px; }
.btn--block { width: 100%; }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 550; font-size: 14px; }
.field small { font-size: 13px; }
input, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
input { height: 44px; }
textarea { resize: vertical; min-height: 96px; }
input:hover, textarea:hover { border-color: #c9cee0; }
input:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon input { padding-left: 40px; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid; }
.alert--error { background: var(--red-50); color: var(--red-600); border-color: rgba(220, 38, 38, .25); }

/* ---------- Login ---------- */
.auth {
  /* Mesma tonalidade verde do menu lateral do painel */
  --brand-600: #047857; --brand-500: #10b981; --brand-50: #ecfdf5;
  --focus: 0 0 0 3px rgba(16, 185, 129, .35);
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(5, 150, 105, .22), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(5, 150, 105, .14), transparent 60%),
    var(--bg);
}
.auth__main { width: 100%; max-width: 420px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 36px 32px; display: grid; gap: 20px;
}
.auth-card__brand { display: flex; align-items: center; gap: 14px; }
.auth-card__brand h1 { font-size: 22px; }
.auth-card__brand p { color: var(--text-muted); font-size: 14px; }
.auth-card__hint { color: var(--text-muted); }
.auth-card__foot { text-align: center; font-size: 13px; color: var(--text-muted); }

.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-500), #8b5cf6); color: #fff; font-weight: 750;
}
.auth .brand-mark { background: linear-gradient(135deg, #10b981, #047857); }
.brand-mark--lg { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: #fff; font-weight: 650; font-size: 17px; }
.sidebar__nav { display: grid; gap: 2px; align-content: start; flex: 1; overflow-y: auto; }
.sidebar__label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7fb8a0; padding: 16px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); text-decoration: none; font-weight: 500;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.is-active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--sidebar-accent); }
.nav-link.is-active .icon { color: var(--sidebar-accent); }
.sidebar__footer { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar__footer .btn--ghost { color: var(--sidebar-text); border-color: rgba(255, 255, 255, .12); }
.sidebar__footer .btn--ghost:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px; min-width: 0; }
.user-chip__text { display: grid; min-width: 0; }
.user-chip__text strong { color: #fff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip__text small { font-size: 12px; color: #8fc2ab; }

.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--brand-50); color: var(--brand-600); font-weight: 650; font-size: 13px;
  overflow: hidden; background-size: cover; background-position: center;
}
.sidebar .brand-mark { background: linear-gradient(135deg, #10b981, #047857); }
.sidebar .avatar { background: rgba(52, 211, 153, .22); color: #a7f3d0; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 32px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.topbar__title { font-size: 18px; }
.topbar__menu { display: none; }
.content { padding: 32px; max-width: 1280px; width: 100%; outline: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h2 { font-size: 24px; margin-bottom: 4px; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Painel ---------- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.module-card {
  display: flex; align-items: center; gap: 16px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: inherit; text-decoration: none; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.module-card:hover { border-color: var(--brand-500); box-shadow: var(--shadow); transform: translateY(-2px); }
.module-card__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; flex: none; }
.module-card__icon .icon { width: 24px; height: 24px; }
.module-card__icon--brand { background: var(--brand-50); color: var(--brand-600); }
.module-card__icon--green { background: var(--green-50); color: var(--green-600); }
.module-card__body { display: grid; gap: 4px; flex: 1; }
.module-card__body .muted { font-size: 14px; }
.module-card__arrow { color: var(--text-muted); }

/* ---------- Estatísticas ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 4px; }
.stat__label { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.stat__value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__value--ok { color: var(--green-600); }
.stat__value--muted { color: var(--text-muted); }

/* ---------- Instâncias ---------- */
.instance-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.instance-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); display: grid; gap: 18px; padding: 20px;
}
.instance-card__head { display: flex; align-items: center; gap: 14px; }
.instance-card__title { flex: 1; min-width: 0; }
.instance-card__title h3 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instance-card__title p { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instance-card__meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.instance-card__meta div { display: grid; gap: 2px; text-align: center; }
.instance-card__meta dt { font-size: 12px; color: var(--text-muted); }
.instance-card__meta dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.instance-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.instance-card__actions [data-action="delete"] { margin-left: auto; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--open { background: var(--green-50); color: var(--green-600); }
.badge--connecting { background: var(--amber-50); color: var(--amber-600); }
.badge--close { background: var(--surface-2); color: var(--text-muted); }

.skeleton-card { height: 220px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--border); }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 56px 24px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); display: grid; gap: 10px; justify-items: center; }
.empty-state h2, .empty-state h3 { font-size: 18px; }

/* ---------- Modais ---------- */
.modal { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 32px); width: 480px; color: var(--text); }
.modal::backdrop { background: rgba(10, 12, 24, .55); backdrop-filter: blur(2px); }
.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal__box { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 24px; display: grid; gap: 18px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal__head h3 { font-size: 18px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; }
#dlg-qr { width: 640px; }
.qr { display: grid; grid-template-columns: 264px 1fr; gap: 24px; align-items: center; }
.qr__frame { width: 264px; height: 264px; display: grid; place-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.qr__frame img { width: 100%; height: 100%; image-rendering: pixelated; }
.qr__frame .qr__done { color: var(--green-600); font-weight: 650; text-align: center; }
.qr__steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--text-muted); }
.qr__status { text-align: center; font-size: 14px; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--brand-500); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 1000; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .16s ease-out; }
.toast--error { background: var(--red-600); color: #fff; }
.toast--ok { background: var(--green-600); color: #fff; }

/* ---------- Menu recolhido (módulos de tela larga) ---------- */
.app--collapsed .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
.app--collapsed .sidebar.is-open { transform: none; }
.app--collapsed .sidebar-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 24, .5); z-index: 40; }
.app--collapsed .topbar { padding: 0 20px; }
.app--collapsed .topbar__menu { display: inline-flex; }
.app--collapsed .content { max-width: none; padding: 20px; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 24, .5); z-index: 40; }
  .topbar { padding: 0 16px; }
  .topbar__menu { display: inline-flex; }
  .content { padding: 20px 16px; }
  .qr { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-width: 420px) {
  .instance-list { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Status de módulo no menu e painel ---------- */
.nav-link__tag { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px; background: rgba(217, 119, 6, .2); color: #fbbf24; }
.module-card.is-disabled { opacity: .7; }
.module-card.is-disabled:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow-sm); }
.module-card__body .badge { vertical-align: 2px; margin-left: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Administração de módulos ---------- */
.admin { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.admin__list {
  position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; display: grid; gap: 8px; max-height: calc(100vh - 120px); grid-template-rows: auto 1fr;
}
.admin__modules { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.admin__loading, .admin__none { display: grid; place-items: center; padding: 24px; font-size: 14px; }
.admin__item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.admin__item:hover { background: var(--surface-2); }
.admin__item.is-active { background: var(--brand-50); }
.admin__item.is-active .admin__item-icon { color: var(--brand-600); }
.admin__item-icon { color: var(--text-muted); display: grid; }
.admin__item-icon .icon { width: 20px; height: 20px; }
.admin__item-text { flex: 1; min-width: 0; display: grid; }
.admin__item-text strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin__item-text small { font-size: 12px; color: var(--text-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot--ok { background: var(--green-600); }
.dot--warn { background: var(--amber-600); }
.dot--off { background: #9aa1bd; }

.admin__editor { min-width: 0; }
.admin-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: grid; gap: 20px; max-width: 760px; }
.admin-form__head { display: flex; align-items: center; gap: 12px; }
.admin-form__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); flex: none; }
.admin-form__icon .icon { width: 22px; height: 22px; }
.admin-form__title { position: relative; flex: 1; min-width: 0; }
.title-input { height: auto; padding: 4px 36px 4px 8px; margin-left: -8px; font-size: 22px; font-weight: 650; border-color: transparent; background: transparent; }
.title-input:hover { border-color: var(--border); }
.title-input__pencil { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--amber-600); pointer-events: none; }
.admin-form__path { margin-top: -14px; font-size: 13px; color: var(--text-muted); }
.admin-form__path code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.admin-form__hint { margin-top: -12px; font-size: 13px; }
.admin-form__foot { display: flex; align-items: center; gap: 16px; padding-top: 4px; }
.admin-form__foot .btn { min-width: 140px; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend, .field__label { font-weight: 550; font-size: 14px; padding: 0; margin-bottom: 6px; display: inline-flex; align-items: center; gap: 6px; }
.field__label .icon { width: 16px; height: 16px; color: var(--text-muted); }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented__opt { position: relative; }
.segmented__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented__opt span { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; font-weight: 550; color: var(--text-muted); background: var(--surface); transition: all .15s; }
.segmented__opt:hover span { border-color: #c9cee0; color: var(--text); }
.segmented__opt input:focus-visible + span { box-shadow: var(--focus); }
.segmented__opt--available input:checked + span { background: var(--green-50); border-color: var(--green-600); color: var(--green-600); }
.segmented__opt--progress input:checked + span { background: var(--amber-50); border-color: var(--amber-600); color: var(--amber-600); }
.segmented__opt--maintenance input:checked + span { background: var(--surface-2); border-color: #9aa1bd; color: var(--text); }
fieldset[disabled] .segmented { opacity: .55; pointer-events: none; }

.access { display: grid; gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-600); }
.access__locked { font-size: 13px; }
.access__group { display: grid; gap: 18px; padding-top: 14px; border-top: 1px dashed var(--border); transition: opacity .15s; }
.access__group.is-muted { opacity: .45; }

.chips { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.chips__empty { font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: 13px; font-weight: 600; }
.chip__remove { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; padding: 0; }
.chip__remove:hover { background: rgba(99, 102, 241, .18); }
.chip__remove .icon { width: 12px; height: 12px; }

.combo { position: relative; }
.combo__list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; }
.combo__opt { width: 100%; display: grid; gap: 1px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.combo__opt:hover, .combo__opt:focus-visible { background: var(--surface-2); box-shadow: none; }
.combo__opt strong { font-size: 14px; font-weight: 600; }
.combo__opt small { font-size: 12px; }
.combo__info { padding: 10px; font-size: 14px; }

select {
  width: 100%; height: 44px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; cursor: pointer;
}
select:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }

@media (max-width: 1100px) {
  .admin { grid-template-columns: 1fr; }
  .admin__list { position: static; max-height: 320px; }
}
.admin__item--sub { padding-left: 34px; position: relative; }
.admin__item--sub::before { content: ""; position: absolute; left: 22px; top: 50%; width: 8px; height: 1px; background: var(--border); }
.admin__item--sub .admin__item-icon .icon { width: 16px; height: 16px; }
.admin-form__sub { margin: -6px 0 0; background: var(--brand-50); color: var(--brand-600); font-size: 13px; }
.admin-form__sub[hidden] { display: none; }
.admin__placeholder[hidden] { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; color: var(--text-muted); }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-600); }
.crumbs strong { color: var(--text); }

/* Árvore de módulos (abre/fecha) */
.admin__list { grid-template-rows: auto auto 1fr; }
.admin__tree-all { justify-self: end; height: 28px; font-size: 12px; }
.admin__row { display: flex; align-items: center; gap: 2px; }
.admin__row .admin__item { flex: 1; min-width: 0; }
.admin__toggle {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-muted); cursor: pointer;
}
.admin__toggle:hover { background: var(--surface-2); color: var(--text); }
.admin__toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.admin__toggle .icon { width: 16px; height: 16px; transition: transform .15s; }
.admin__toggle.is-open .icon { transform: rotate(90deg); }
.admin__node > .admin__item { margin-left: 28px; width: calc(100% - 28px); }
.admin__children { list-style: none; margin: 0 0 4px 40px; padding: 0 0 0 8px; border-left: 2px solid var(--border); display: grid; gap: 2px; }
.admin__children[hidden] { display: none; }
.admin__item--sub { padding-left: 10px; }
.admin__item--sub::before { content: none; }
.admin__count { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.admin__count--warn { background: var(--amber-50); color: var(--amber-600); }

/* Menu lateral em dois níveis */
.nav-group__head { display: flex; align-items: center; gap: 2px; }
.nav-group__head .nav-link { flex: 1; min-width: 0; }
.nav-link.is-parent { color: #fff; }
.nav-link.is-parent .icon { color: var(--sidebar-accent); }
.nav-group__toggle {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: rgba(255, 255, 255, .55); cursor: pointer;
}
.nav-group__toggle:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-group__toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.nav-group__toggle .icon { width: 15px; height: 15px; transition: transform .15s; }
.nav-group.is-open .nav-group__toggle .icon { transform: rotate(90deg); }
.nav-group__items { display: none; margin: 2px 0 6px 21px; padding-left: 10px; border-left: 1px solid rgba(110, 231, 183, .25); }
.nav-group.is-open .nav-group__items { display: grid; gap: 1px; }
.nav-sublink {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 14px;
  color: rgba(255, 255, 255, .7); text-decoration: none;
}
.nav-sublink .icon { width: 16px; height: 16px; }
.nav-sublink span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-sublink:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-sublink.is-active { background: var(--sidebar-active); color: #fff; }
.nav-sublink.is-active .icon { color: var(--sidebar-accent); }
.sidebar__nav { overflow-x: hidden; }
.nav-group, .nav-group__items, .nav-sublink { min-width: 0; }

/* ---------- Painel do topo dos módulos: compacto (mais espaço para os dados) ---------- */
.content :is(.lg-hero, .po-hero, .rec-hero, .os-head) { padding: 12px 20px; margin-bottom: 12px; gap: 16px; align-items: center; }
.content :is(.lg-hero, .po-hero, .rec-hero, .os-head) h2 { margin: 2px 0; font-size: 19px; }
.content :is(.lg-hero, .po-hero, .rec-hero) p { font-size: 13px; line-height: 1.4; }
.content :is(.lg-hero__stats, .po-hero__stats, .rec-hero__stats, .os-stats) { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.content :is(.lg-hero__stats, .po-hero__stats, .rec-hero__stats, .os-stats) > div { min-width: 110px; padding: 6px 12px; }
.content :is(.lg-hero__stats, .po-hero__stats, .rec-hero__stats, .os-stats) dt { font-size: 11px; }
.content :is(.lg-hero__stats, .po-hero__stats, .rec-hero__stats, .os-stats) dd { margin: 0; font-size: 17px; line-height: 1.3; }
@media (max-width: 900px) {
  .content :is(.lg-hero__stats, .po-hero__stats, .rec-hero__stats, .os-stats) { justify-content: flex-start; }
}

/* ---------- Aparência (botão no topo: cor do tema, fundo e zoom; js/aparencia.js) ---------- */
.topbar__tools { margin-left: auto; position: relative; display: flex; align-items: center; gap: 8px; }
.topbar__aparencia { gap: 6px; }
.content { zoom: var(--portal-zoom, 1); }
.aparencia {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 248px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.aparencia__t { margin: 8px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.aparencia__t:first-child { margin-top: 0; }
.aparencia__cores { display: flex; flex-wrap: wrap; gap: 8px; }
.aparencia__cor { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.aparencia__cor[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.aparencia__cor--verde { background: #059669; } .aparencia__cor--azul { background: #2563eb; } .aparencia__cor--petroleo { background: #0f766e; }
.aparencia__cor--roxo { background: #7c3aed; } .aparencia__cor--vinho { background: #be123c; } .aparencia__cor--laranja { background: #ea580c; }
.aparencia__cor--grafite { background: #475569; }
.aparencia__seg { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.aparencia__seg button { flex: 1; padding: 5px 6px; border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.aparencia__seg button + button { border-left: 1px solid var(--border); }
.aparencia__seg button[aria-pressed="true"] { background: var(--t2, #065f46); color: #fff; }
.aparencia__reset { margin-top: 10px; width: 100%; padding: 5px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: none; color: var(--text-muted); font: inherit; font-size: 12.5px; cursor: pointer; }
@media (max-width: 600px) { .topbar__aparencia span { display: none; } }

/* Cores do tema: t1 escuro → t3 claro, t4 = texto claro sobre o topo. Verde = padrão (sem data-tema). */
:root[data-tema="azul"]     { --t1: #0b1f4d; --t2: #1d4ed8; --t3: #3b82f6; --t4: #bfdbfe; }
:root[data-tema="petroleo"] { --t1: #042f2e; --t2: #0f766e; --t3: #14b8a6; --t4: #99f6e4; }
:root[data-tema="roxo"]     { --t1: #2e1065; --t2: #6d28d9; --t3: #8b5cf6; --t4: #ddd6fe; }
:root[data-tema="vinho"]    { --t1: #4c0519; --t2: #9f1239; --t3: #e11d48; --t4: #fecdd3; }
:root[data-tema="laranja"]  { --t1: #431407; --t2: #c2410c; --t3: #f97316; --t4: #fed7aa; }
:root[data-tema="grafite"]  { --t1: #0f172a; --t2: #334155; --t3: #64748b; --t4: #cbd5e1; }
:root[data-tema] {
  --brand-600: var(--t2); --brand-500: var(--t3); --green-600: var(--t2);
  --sidebar-bg: linear-gradient(180deg, var(--t1) 0%, var(--t2) 100%);
  --sidebar-text: var(--t4); --sidebar-accent: var(--t4); --sidebar-active: rgba(255, 255, 255, .16);
  --focus: 0 0 0 3px color-mix(in srgb, var(--t3) 40%, transparent);
}
:root[data-tema] :is(.lg-hero, .po-hero, .al-hero, .rec-hero, .ft-hero, .pc-hero) { background: linear-gradient(120deg, var(--t1), var(--t2) 60%, var(--t3)); }
:root[data-tema] :is(.lg-hero__eyebrow, .po-hero__eyebrow, .rec-hero__eyebrow, .lg-hero__stats dt, .po-hero__stats dt, .rec-hero__stats dt) { color: var(--t4); }
:root[data-tema] :is(.lg-hero p, .po-hero p) { color: rgba(255, 255, 255, .85); }
:root[data-tema] :is(.rn-hero-btn--light, .car-hero-btn--light) { color: var(--t2); }
:root[data-tema] .sidebar .avatar { background: rgba(255, 255, 255, .18); color: #fff; }
:root[data-tema] :is(.os-head, .car-selbar) { background: linear-gradient(120deg, var(--t1), var(--t2) 60%, var(--t3)); }
:root[data-tema] .os-eyebrow { color: var(--t4); }
:root[data-tema] :is(.rn-table th, .car-table th, .os-table th, .rc-subtable th) { background: color-mix(in srgb, var(--t3) 10%, transparent); color: var(--t2); }
:root[data-tema] .rc-custo { color: var(--t2); }
:root[data-tema][data-fundo="escuro"] :is(.rn-table th, .car-table th, .os-table th, .rc-subtable th, .rc-custo) { color: var(--t4); }
@media (prefers-color-scheme: dark) { :root[data-tema]:not([data-fundo="claro"]) :is(.rn-table th, .car-table th, .os-table th, .rc-subtable th, .rc-custo) { color: var(--t4); } }

/* ---------- Menu lateral compacto (2026-10-15): mais estreito, letras menores, itens mais baixos ---------- */
:root { --sidebar-w: 232px; }
.sidebar { padding: 12px 8px 10px; }
.sidebar__brand { gap: 8px; padding: 2px 6px 12px; font-size: 15px; letter-spacing: .01em; }
.sidebar .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.sidebar__nav { gap: 1px; padding-right: 2px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.sidebar__nav::-webkit-scrollbar { width: 5px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 4px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__label { font-size: 9.5px; font-weight: 600; letter-spacing: .12em; padding: 12px 10px 4px; color: color-mix(in srgb, var(--sidebar-text) 60%, transparent); }
.sidebar__label:first-child { padding-top: 2px; }
.nav-link { gap: 9px; padding: 6px 10px; border-radius: 7px; font-size: 13px; font-weight: 500; line-height: 1.25;
  transition: background .15s, color .15s; }
.nav-link .icon { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav-link > span:not(.nav-link__tag) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover .icon { opacity: 1; }
.nav-link.is-active { background: linear-gradient(90deg, var(--sidebar-active), transparent); box-shadow: inset 2px 0 0 var(--sidebar-accent); font-weight: 600; }
.nav-link.is-active .icon, .nav-link.is-parent .icon { opacity: 1; }
.nav-link__tag { font-size: 8.5px; padding: 1px 5px; }
.nav-group__toggle { width: 22px; height: 22px; border-radius: 6px; color: rgba(255, 255, 255, .4); }
.nav-group__toggle .icon { width: 12px; height: 12px; }
.nav-group__items { margin: 1px 0 4px 17px; padding-left: 8px; border-left-color: color-mix(in srgb, var(--sidebar-accent) 25%, transparent); }
.nav-sublink { gap: 7px; padding: 4px 8px; border-radius: 6px; font-size: 12px; color: color-mix(in srgb, var(--sidebar-text) 80%, transparent); transition: background .15s, color .15s; }
.nav-sublink .icon { width: 13px; height: 13px; opacity: .8; }
.nav-sublink.is-active { font-weight: 600; }
/* Rodapé numa linha: avatar, usuário e botão Sair só com ícone. */
.sidebar__footer { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; padding-top: 8px; }
.sidebar .user-chip { gap: 8px; padding: 2px; }
.sidebar .avatar { width: 28px; height: 28px; font-size: 11px; }
.sidebar .user-chip__text strong { font-size: 12px; }
.sidebar .user-chip__text small { font-size: 10.5px; color: color-mix(in srgb, var(--sidebar-text) 70%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__footer form .btn { width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: 8px; }
.sidebar__footer form .btn .icon { width: 15px; height: 15px; }
.sidebar__footer form .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Telas de módulos: cards compactos e visão em Lista (botão Cards/Lista; app.js) ---------- */
.page-head:has(+ .module-grid) { margin-bottom: 12px; align-items: center; }
.page-head:has(+ .module-grid) h2 { font-size: 19px; margin-bottom: 2px; }
.page-head:has(+ .module-grid) .muted { font-size: 13px; }
.module-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.module-card { gap: 10px; padding: 10px 12px; border-radius: 10px; }
.module-card:hover { transform: translateY(-1px); }
.module-card__icon { width: 34px; height: 34px; border-radius: 9px; }
.module-card__icon .icon { width: 18px; height: 18px; }
.module-card__body { gap: 2px; min-width: 0; }
.module-card__body strong { font-size: 13.5px; line-height: 1.3; }
.module-card__body .muted { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.module-card__arrow { width: 14px; height: 14px; flex: none; }
.module-card__body .badge { font-size: 10px; padding: 1px 6px; }

.view-toggle { display: inline-flex; gap: 2px; padding: 2px; margin-left: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.view-toggle button { border: 0; background: transparent; color: var(--text-muted); font: 600 12px var(--font); padding: 4px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.view-toggle button:hover { color: var(--text); }
.view-toggle button[aria-pressed="true"] { background: var(--brand-50); color: var(--brand-600); }

/* Lista: uma linha por rotina, nome e descrição lado a lado, dentro de um só quadro. */
:root[data-visao="lista"] .module-grid { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); }
:root[data-visao="lista"] .module-card { border: 0; border-radius: 0; box-shadow: none; padding: 6px 12px; border-top: 1px solid var(--border); }
:root[data-visao="lista"] .module-card:first-child { border-top: 0; }
:root[data-visao="lista"] .module-card:hover { transform: none; background: var(--surface-2); }
:root[data-visao="lista"] .module-card__icon { width: 26px; height: 26px; border-radius: 7px; }
:root[data-visao="lista"] .module-card__icon .icon { width: 15px; height: 15px; }
:root[data-visao="lista"] .module-card__body { display: flex; align-items: baseline; gap: 14px; }
:root[data-visao="lista"] .module-card__body strong { flex: 0 0 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-visao="lista"] .module-card__body .muted { -webkit-line-clamp: 1; flex: 1; min-width: 0; }
@media (max-width: 700px) {
  :root[data-visao="lista"] .module-card__body { display: grid; gap: 0; }
  :root[data-visao="lista"] .module-card__body strong { flex: none; }
}

/* Sino de notificações do topo */
.topbar__notify { position: relative; }
.topbar__notify > .btn { position: relative; font-size: 16px; }
.notify-count { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red-600); color: #fff; font: 700 10px/16px var(--font); text-align: center; }
.notify-count[hidden], .notify-panel[hidden] { display: none; }
.notify-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; width: 340px; max-width: calc(100vw - 16px); max-height: 420px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.notify-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notify-panel__head .btn { height: 26px; padding: 0 8px; font-size: 11.5px; }
[data-notify-rows] { overflow-y: auto; }
.notify-row { display: block; padding: 7px 10px 7px 12px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 12.5px; line-height: 1.35; text-decoration: none; }
.notify-row:last-child { border-bottom: 0; }
a.notify-row:hover { background: var(--surface-2); }
.notify-row.is-unread { font-weight: 600; box-shadow: inset 3px 0 0 var(--green-600); background: var(--green-50); }
.notify-row small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 10.5px; font-weight: 400; }

/* =====================================================================================
   PADRÃO COMPACTO DO PORTAL (2026-10-15, pedido do usuário): todas as telas densas, no estilo
   de Parceiros / Portal de Vendas. Vale só dentro do portal autenticado (.app); o login fica como está.
   Telas novas devem seguir este padrão (ver CLAUDE.md na raiz do projeto).
   ===================================================================================== */
.app { font-size: 14px; }
.app .topbar { height: 48px; padding: 0 18px; }
.app .topbar__title { font-size: 15.5px; }
.app .content { padding: 14px 18px 18px; max-width: 1680px; }
.app .crumbs { margin-bottom: 8px; font-size: 12.5px; gap: 6px; }

/* Botões e campos mais baixos */
.app .btn { height: 34px; padding: 0 12px; font-size: 13.5px; gap: 6px; }
.app .btn .icon { width: 16px; height: 16px; }
.app .btn--sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.app .btn--sm .icon { width: 14px; height: 14px; }
.app .btn--sm.btn--danger-ghost { width: 28px; padding: 0; }
.app .btn--icon { width: 34px; padding: 0; }
.app .btn--lg { height: 40px; font-size: 14.5px; }
.app .form { gap: 10px; }
.app .field { gap: 3px; }
.app .field label, .app .field__label { font-size: 12.5px; }
.app .field small { font-size: 12px; }
.app input { height: 34px; padding: 6px 10px; font-size: 13.5px; }
.app textarea { padding: 6px 10px; font-size: 13.5px; min-height: 70px; }
.app select { height: 34px; padding: 0 8px; font-size: 13.5px; }
.app input[type="checkbox"], .app input[type="radio"] { height: auto; padding: 0; }
.app .input-icon .icon { left: 10px; width: 15px; height: 15px; }
.app .input-icon input { padding-left: 32px; }

/* Cabeçalhos de página, faixas coloridas (hero) e indicadores */
.app .page-head { margin-bottom: 12px; gap: 10px; }
.app .page-head h2 { font-size: 19px; margin-bottom: 2px; }
.app .page-head .muted { font-size: 13px; }
.content :is(.lg-hero, .po-hero, .rec-hero, .car-hero, .al-hero, .ft-hero, .pc-hero) { padding: 10px 16px; margin-bottom: 10px; gap: 12px; align-items: center; }
.content :is(.lg-hero, .po-hero, .rec-hero, .car-hero, .al-hero, .ft-hero, .pc-hero) h2 { margin: 1px 0; font-size: 18px; }
.content :is(.lg-hero, .po-hero, .rec-hero, .car-hero, .al-hero, .ft-hero, .pc-hero) p { font-size: 12.5px; line-height: 1.35; }
.content :is(.lg-hero__eyebrow, .po-hero__eyebrow, .rec-hero__eyebrow) { font-size: 10.5px; }
.content :is(.lg-hero__stats, .po-hero__stats, .rec-hero__stats, .os-stats) > div { padding: 4px 10px; }
.content :is(.lg-hero__stats, .po-hero__stats, .rec-hero__stats, .os-stats) dd { font-size: 16px; }
.app .stats { gap: 10px; margin-bottom: 12px; }
.app .stat { padding: 10px 14px; gap: 2px; }
.app .empty-state { padding: 24px 16px; }

/* Quadros e tabelas densos: uma linha por registro */
.app .lg-card > :is(.lg-toolbar, .pc-tablebar, .vd-tablebar) { padding: 6px 10px; }
.app :is(.pc-filtros, .vd-filtros) { padding: 10px 12px; gap: 8px 10px; margin-bottom: 10px; }
.app :is(.pc-head, .vd-head) { padding: 8px 12px; margin-bottom: 8px; }
.app .lg-table { font-size: 13px; }
.app .lg-table th { padding: 6px 10px; font-size: 11px; }
.app .lg-table td { padding: 6px 10px; }
.app .lg-table--compact td { padding: 4px 8px; }
.app .lg-table__empty { padding: 24px 12px !important; }
.app .alert { padding: 8px 12px; font-size: 13px; }
@media (max-width: 900px) { .app .content { padding: 10px 10px 16px; } .app .topbar { padding: 0 10px; } }
/* Indicadores (WhatsApp e outros), instâncias e Módulos e acessos */
.app .stat__label { font-size: 12px; }
.app .stat__value { font-size: 20px; line-height: 1.2; }
.app .instance-list { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.app .instance-card { padding: 12px; gap: 10px; }
.app .instance-card__meta { padding: 8px; }
.app .admin { gap: 12px; grid-template-columns: 270px 1fr; }
.app .admin__list { top: 60px; padding: 8px; gap: 6px; max-height: calc(100vh - 80px); }
.app .admin__item { padding: 6px 8px; gap: 8px; }
.app .admin__item-icon .icon { width: 16px; height: 16px; }
.app .admin__item-text strong { font-size: 13px; }
.app .admin__item-text small { font-size: 11px; }
.app .admin-form { padding: 16px 18px; gap: 12px; }
.app .admin-form__icon { width: 34px; height: 34px; border-radius: 9px; }
.app .admin-form__icon .icon { width: 18px; height: 18px; }
.app .admin-form__path { margin-top: -8px; }
.app .admin-form__hint { margin-top: -6px; font-size: 12px; }
.app fieldset.field legend, .app .field__label { margin-bottom: 3px; }
.app .segmented { gap: 6px; }
.app .segmented__opt span { height: 30px; padding: 0 12px; font-size: 13px; }

/* Administração de acessos: abrangência Total/Parcial por usuário/grupo e sub-módulo. */
.segmented__opt input:checked + span { background: var(--brand-50); border-color: var(--brand-600); color: var(--brand-600); }
.chips--rows { display: grid; gap: 6px; }
.chip--row { display: grid; gap: 6px; border-radius: 8px; padding: 6px 8px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.chip__head { display: flex; align-items: center; gap: 8px; }
.chip__name { flex: 1; font-weight: 600; color: var(--brand-600); }
.chip__scope { height: 28px; font-size: 12px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.chip--row .access__subs { padding-left: 4px; }
.access__scope { display: grid; gap: 6px; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.access__scope .segmented__opt span { height: 30px; padding: 0 12px; font-size: 12px; }
.access__subs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.access__subs .check { font-size: 12px; }
.access__subs[hidden], .access__scope[hidden] { display: none; }
