/*
 * Design system do painel administrativo (ver DESIGN.md e
 * .project-rules/core/admin-design-system.md). Carrega DEPOIS do bootstrap 3
 * e sobrescreve o que precisa: topo colorido 72px, lateral branca 270px,
 * Montserrat 13.5px, cartões #FBF9F9, botões `btn-main` / `btn-outline-main`.
 * A cor de marca entra só por `--p`; nada aqui depende do valor dela.
 */

@font-face {
  font-family: "Montserrat";
  src: url(/fonts/montserrat/Montserrat-VariableFont_wght.ttf) format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --p: #D12E5E;
  --p-light: color-mix(in srgb, var(--p) 20%, #fff);
  --p-soft: color-mix(in srgb, var(--p) 8%, #fff);
  --ink: #444444;
  --heading: #333333;
  --muted: #9c9c9c;
  --note: #868e96;
  --card-bg: #FBF9F9;
  --card-ring: #F2F0F0;
  --card-header: #F4F4F4;
  --input-border: #B6B6B6;
  --success: #32c787;
  --error: #ff6b68;
  --warning: #ffc721;
  --info: #2196F3;
  --success-text: #15803d;
  --error-text: #dc2626;
  --warning-text: #b45309;
  --info-text: #1d4ed8;
  --radius-sm: 6px;
  --radius-md: 7px;
  --radius-card: 10px;
  --radius-input: 0.375rem;
  --header-h: 72px;
  --sidebar-w: 270px;
}

/* Este arquivo NÃO entra no application.css (o site público carrega aquele bundle):
   é linkado só pelos layouts do painel (`application` e `auth`). */
body.admin *, body.admin *:before, body.admin *:after,
body.auth *, body.auth *:before, body.auth *:after { box-sizing: border-box; }

/* Bootstrap 3 põe `html { font-size: 10px }` e encolhe todo `rem` daqui (1rem viraria
   10px). O painel trabalha com base 16px, igual ao Conecta; o site público não carrega
   este bundle, então nada muda lá. */
html { font-size: 16px; }

body.admin {
  margin: 0;
  font-family: Montserrat, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
body.admin a { color: var(--p); text-decoration: none; }
body.admin a:hover { color: var(--p); text-decoration: underline; }
body.admin h1, body.admin h2, body.admin h3, body.admin h4, body.admin h5, body.admin h6 {
  font-family: inherit; color: var(--heading); font-weight: 600;
}
body.admin code { color: var(--p); background: var(--p-soft); border-radius: 4px; font-size: 90%; }
body.admin hr { border-color: var(--card-ring); }

/* FOCO: sempre visível, na cor de marca; branco sobre o topo colorido */
body.admin a:focus-visible, body.admin button:focus-visible, body.admin [tabindex]:focus-visible {
  outline: 2px solid var(--p); outline-offset: 2px;
}
.header :focus-visible { outline-color: #fff; }

/* ícones em traço (SVG inline via ui_icon) */
.ui-icon { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -0.25em; flex-shrink: 0; }

/* ---------- TOPO: 72px, cor de marca, fixo ---------- */
.header {
  position: fixed; top: 0; left: 0; width: 100%; height: var(--header-h); z-index: 1001;
  background: var(--p); color: #fff; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  box-shadow: 0 5px 5px -3px rgba(0, 0, 0, .15);
}
.header a { color: #fff; }
.header a:hover { color: #fff; text-decoration: none; }
.header__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header__brand img { height: 26px; width: auto; }
.header__brand h1 {
  font-size: 1.3rem; font-weight: 500; margin: 0; line-height: 1.1; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 1px solid rgba(255, 255, 255, .45); padding-left: 12px;
}
.header__brand h1 small { display: block; font-size: .8rem; opacity: .85; margin-top: 3px; font-weight: 400; color: #fff; }
.header__toggle { display: none; background: none; border: 0; color: #fff; padding: .4rem; margin-right: .5rem; border-radius: 4px; }
.header__env { background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; letter-spacing: 1px; }

/* seletor de aplicação no topo */
.app-switch { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-switch__label { font-size: .9rem; opacity: .9; white-space: nowrap; }
.app-switch__btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 360px;
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .35);
  color: #fff; border-radius: var(--radius-input); height: 42px; padding: 0 12px 0 14px;
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-switch__btn:hover { background: rgba(255, 255, 255, .25); }
.app-switch__btn[disabled] { cursor: default; }
.app-switch__btn[disabled]:hover { background: rgba(255, 255, 255, .15); }

.top-nav { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.top-nav a {
  color: #fff; min-width: 44px; height: 44px; padding: .5rem .35rem; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.top-nav a:hover { background: rgba(255, 255, 255, .2); }
.top-nav .ui-icon { width: 20px; height: 20px; }

/* ---------- LATERAL: branca, fixa, 270px ---------- */
.sidebar {
  position: fixed; left: 0; top: 0; width: var(--sidebar-w); height: 100%; background: #fff;
  padding: calc(var(--header-h) + 30px) 1.5rem 1.5rem; z-index: 1000; overflow-y: auto;
  border-right: 1px solid var(--card-ring); display: flex; flex-direction: column;
  transition: transform .2s ease;
}
.sidebar__logout-form { margin-top: auto; padding-top: 1.5rem; }
.user { margin: 0 0 1.5rem; }
.user__info { display: flex; align-items: center; border-radius: var(--radius-md); padding: .35rem; }
.user__img {
  width: 3rem; height: 3rem; border-radius: 50%; margin-right: .8rem; background: var(--p-light);
  display: flex; align-items: center; justify-content: center; color: var(--p); flex-shrink: 0;
}
.user__name { color: var(--heading); font-weight: 600; font-size: 1.1rem; line-height: 1.2; word-break: break-all; }
.user__email { color: var(--heading); margin-top: .2rem; line-height: 1.2; font-size: .85rem; opacity: .75; word-break: break-all; }
.navigation { list-style: none; padding: 0; margin: 0; }
.navigation > li + li { margin-top: .15rem; }
.navigation > li > a {
  display: flex; align-items: center; padding: .8rem .6rem; border-radius: var(--radius-md);
  color: var(--ink); font-weight: 500; font-size: 15px;
}
.navigation > li > a .ni { width: 1.5rem; margin-right: .7rem; display: flex; justify-content: center; flex-shrink: 0; }
.navigation > li > a .ni .ui-icon { width: 22px; height: 22px; }
.navigation > li > a:hover { text-decoration: none; }
.navigation > li > a:not(.active):hover { background: var(--card-ring); color: var(--p); }
/* item ativo: FUNDO na cor de marca, texto branco */
.navigation > li > a.active { background: var(--p); color: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .12); }
.navigation__group-label {
  padding: 1.1rem .6rem .4rem; font-size: .74rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: rgba(68, 68, 68, .6);
}
.btn-sidebar-logout {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: .6rem; background: #E8E8E8; color: var(--p);
  border: 0; border-radius: var(--radius-md); font-weight: 500; padding: .85rem .5rem; cursor: pointer;
  font-family: inherit; font-size: 15px;
}
.btn-sidebar-logout:hover { background: #ddd; text-decoration: none; }
.sidebar__backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 999; }

/* ---------- CONTEÚDO ---------- */
.content { padding: calc(var(--header-h) + 30px) 30px 40px var(--sidebar-w); min-height: 100vh; }
.content__inner { margin: 0 auto; max-width: 1280px; padding-left: 30px; }

/* cabeçalho de página: h1 | paginação central | ações */
.content__title {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.content__title h1 {
  font-size: 1.8rem; font-weight: 700; margin: 0; line-height: 1.1; color: var(--heading);
  display: flex; align-items: center; gap: .6rem; min-width: 0;
}
.content__title h1 small { font-size: .85rem; font-weight: 500; color: var(--note); white-space: nowrap; }
.content__title .pagination-center { flex: 1; display: flex; justify-content: center; align-items: center; }
.content__title .actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; flex-wrap: wrap; }
.actions__item {
  color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: var(--radius-md); background: transparent; border: 0;
}
.actions__item:hover { color: var(--p); background: rgba(0, 0, 0, .08); text-decoration: none; }
.actions__item .ui-icon { width: 22px; height: 22px; }

/* ---------- CARD ---------- */
.card {
  background: var(--card-bg); border: 0; border-radius: var(--radius-card); margin-bottom: 1.5rem;
  box-shadow: 0 0 0 1px var(--card-ring), 0 2px 4px rgba(0, 0, 0, .04);
}
.card-header {
  background: var(--card-header); border-bottom: 1px solid #e0e0e0; padding: 1rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}
.card-header h4 { font-size: 1.25rem; font-weight: 600; margin: 0; color: var(--heading); }
.card-header .sec-title { display: flex; align-items: center; gap: .75rem; }
.card-header .sec-icon { color: var(--p); display: flex; }
.card-header .sec-icon .ui-icon { width: 1.4em; height: 1.4em; }
.card-header .sec-actions { display: flex; align-items: center; gap: .5rem; }
.card-body { padding: 1.4rem; }
.card-body--flush { padding: 0; }
.card-footer { padding: .8rem 1.4rem; border-top: 1px solid var(--card-ring); color: var(--note); font-size: .9rem; }
.card-body > .card { background: #fff; }

/* abas de status: visual de pasta, coladas no card */
.status-filters { padding-left: 1.25rem; }
.filter-tabs { display: inline-flex; gap: 2px; }
.filter-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px 12px;
  border-radius: 8px 8px 0 0; color: #64748b; font-weight: 500; font-size: 13px; min-height: 36px;
  background: #f8f9fa; border: 1px solid #e2e8f0; border-bottom: none; margin-bottom: -1px;
}
.filter-tab:hover { color: #475569; background: #e2e8f0; text-decoration: none; }
.filter-tab--active { background: #fff; color: #1e293b; border-bottom: 1px solid #fff; box-shadow: 0 -2px 4px rgba(0, 0, 0, .05); position: relative; z-index: 1; }
.filter-tab__badge { background: #94a3b8; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 8px; min-width: 16px; text-align: center; }
.filter-tab--active .filter-tab__badge { background: #475569; }
.status-filters + .card { border-top-left-radius: 0; margin-top: 0; }

/* barra de ferramentas da listagem: busca + filtros + botão principal */
.toolbar-stack { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar-stack .search-form { margin: 0; }
.toolbar-stack__spacer { flex: 1; }
.search-form { position: relative; flex: 1; min-width: 220px; max-width: 480px; margin: 0; }
.search-form input {
  width: 100%; height: 40px; padding: 0 2.75rem 0 1rem; border: 1px solid var(--input-border);
  border-radius: var(--radius-input); background: #fff; font-size: 13.5px; font-family: inherit; color: var(--ink);
}
.search-form input:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 2px var(--p); }
.search-form button {
  position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); color: var(--note); background: none;
  border: 0; display: flex; padding: .5rem; border-radius: 4px;
}
.search-form button:hover { color: var(--p); }
.filter-inline { display: flex; align-items: center; gap: .5rem; }
.filter-inline label { margin: 0; font-weight: 500; white-space: nowrap; }
.filter-inline select.form-control { width: auto; min-width: 150px; }

/* ---------- BOTÕES ---------- */
body.admin .btn {
  height: 40px; min-width: 0; padding: 0 16px; border-radius: var(--radius-md); border: 2px solid transparent;
  font-weight: 500; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; font-family: inherit; white-space: nowrap; line-height: 1; box-shadow: none;
  text-shadow: none; background-image: none;
}
body.admin .btn:hover, body.admin .btn:focus { text-decoration: none; }
body.admin .btn-main { background: var(--p); border-color: var(--p); color: #fff; }
body.admin .btn-main:hover, body.admin .btn-main:focus { background: var(--p); color: #fff; filter: brightness(1.15); }
body.admin .btn-outline-main { background: transparent; border-color: var(--p); color: var(--p); }
body.admin .btn-outline-main:hover, body.admin .btn-outline-main:focus { background: var(--p-soft); color: var(--p); }
body.admin .btn-secondary, body.admin .btn-default { background: #fff; border-color: #ced4da; color: #495057; }
body.admin .btn-secondary:hover, body.admin .btn-default:hover { background: #f1f3f5; color: #495057; }
body.admin .btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
body.admin .btn-danger:hover { background: #ff5552; border-color: #ff5552; color: #fff; }
body.admin .btn-success { background: var(--success); border-color: var(--success); color: #fff; }
body.admin .btn-success:hover { background: #2bb379; border-color: #2bb379; color: #fff; }
body.admin .btn-link { color: var(--p); background: none; border-color: transparent; }
body.admin .btn-sm, body.admin .btn-xs { height: 32px; padding: 0 10px; font-size: 12px; }
body.admin .btn-block { display: flex; width: 100%; }
body.admin .btn-group { display: inline-flex; gap: .25rem; }
body.admin .btn-group > .btn, body.admin .btn-group > .btn:first-child, body.admin .btn-group > .btn:last-child { border-radius: var(--radius-md); margin-left: 0; }
body.admin .btn-group.view-toggle { gap: 0; }
body.admin .btn-group.view-toggle > .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
body.admin .btn-group.view-toggle > .btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
body.admin .btn-group.view-toggle > .btn.active { background: var(--p); border-color: var(--p); color: #fff; box-shadow: none; }

/* ---------- TABELA ---------- */
.tablewrap { overflow-x: auto; }
body.admin .table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 0; }
body.admin .table > thead > tr > th,
body.admin .table > tbody > tr > td,
body.admin .table > tbody > tr > th {
  padding: .75rem 1rem; text-align: left; vertical-align: middle; border: 0; border-bottom: 1px solid #dee2e6;
}
body.admin .table > thead > tr > th { font-weight: 700; color: #000; white-space: nowrap; border-bottom: 2px solid #dee2e6; }
body.admin .table th a { color: #000; display: inline-flex; align-items: center; gap: .25rem; }
body.admin .table th a:hover { color: var(--p); text-decoration: none; }
body.admin .table th a .ui-icon { width: 14px; height: 14px; opacity: .6; }
body.admin .table > tbody > tr:nth-child(even) { background: var(--card-bg); }
body.admin .table > tbody > tr:nth-child(odd) { background: var(--card-ring); }
body.admin .table > tbody > tr:hover { background: rgba(0, 0, 0, .04); }
body.admin .table .text-muted { color: var(--note); }
.actions-column { width: 1%; min-width: 112px; white-space: nowrap; }
.actions-column a, .actions-column button {
  color: var(--ink); display: inline-flex; padding: 6px; margin: 0 1px; border-radius: 6px; background: none; border: 0;
}
.actions-column a:hover, .actions-column button:hover { color: var(--p); background: rgba(0, 0, 0, .06); text-decoration: none; }
.actions-column .ui-icon { width: 18px; height: 18px; }
.actions-column a.is-danger:hover { color: var(--error-text); }
.table-wrap { display: inline-block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.table .thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: #fff; }
.empty-row td { text-align: center; color: var(--note); padding: 1.5rem 1rem !important; }
.table-show th { text-align: right; width: 20%; color: #5a6268; text-transform: uppercase; font-size: .78rem; letter-spacing: .3px; }

/* selos */
.badge-status {
  display: inline-block; padding: .3rem .55rem; font-size: .72rem; font-weight: 600; line-height: 1;
  border-radius: var(--radius-md); color: #fff; white-space: nowrap;
}
.badge-status--success { background: var(--success-text); }
.badge-status--danger { background: var(--error-text); }
.badge-status--warning { background: var(--warning-text); }
.badge-status--info { background: var(--info-text); }
.badge-status--neutral { background: #6c757d; }
.badge-status--primary { background: var(--p); }
body.admin .label { border-radius: var(--radius-md); font-weight: 600; padding: .3em .6em; font-size: 72%; }
body.admin .label-info { background: var(--info-text); }
body.admin .label-success { background: var(--success-text); }
body.admin .label-danger { background: var(--error-text); }
body.admin .label-warning { background: var(--warning-text); }
body.admin .label-primary { background: var(--p); }
body.admin .badge { background: #6c757d; border-radius: 10px; font-weight: 600; font-size: 11px; }

/* ---------- PAGINAÇÃO ---------- */
body.admin .pagination { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
body.admin .pagination > li > a, body.admin .pagination > li > span {
  display: flex; align-items: center; justify-content: center; min-width: 30px; height: 30px;
  padding: 0 .75rem; margin: 0 2px; border: 1px solid #dee2e6; border-radius: var(--radius-md); background: #fff;
  color: var(--ink); font-size: 13px; font-weight: 500; float: none; line-height: 1;
}
body.admin .pagination > li > a:hover { background: var(--card-ring); color: var(--p); border-color: transparent; text-decoration: none; }
body.admin .pagination > li.active > a, body.admin .pagination > li.active > span,
body.admin .pagination > li.active > a:hover { background: var(--p); border-color: var(--p); color: #fff; }
body.admin .pagination > li.disabled > span, body.admin .pagination > li.disabled > a { opacity: .6; background: #fff; color: var(--ink); }
.pagination-block { position: relative; margin-top: 1rem; display: flex; justify-content: center; }

/* ---------- DETALHE: rótulo em maiúsculas, divisória abaixo ---------- */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1.5rem; }
.row1 { display: grid; grid-template-columns: 1fr; }
@media (max-width: 900px) { .row2, .row3 { grid-template-columns: 1fr; } }
.show-field { position: relative; padding-bottom: 1.25rem; margin-bottom: 1.25rem; min-width: 0; }
.show-field:after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: rgba(0, 0, 0, .1); }
.show-field--full { grid-column: 1 / -1; }
.show-label { font-size: .85rem; font-weight: 700; text-transform: uppercase; color: #5a6268; letter-spacing: .3px; display: block; margin: 0 0 .45rem; }
.show-value { font-size: 1rem; color: var(--ink); display: block; line-height: 1.5; word-break: break-word; }
.show-value a { color: var(--p); }
.show-value img { max-width: 100%; height: auto; border-radius: 6px; }
.show-value .img-thumbnail { padding: 4px; background: #fff; border: 1px solid #ddd; border-radius: 6px; max-width: 160px; }
.show-value--rich { background: #fff; border: 1px solid var(--card-ring); border-radius: 6px; padding: 1rem; }
.show-empty { color: var(--muted); font-style: italic; }
.kv-list { margin: 0; }
.kv-list dt { font-size: .85rem; font-weight: 700; text-transform: uppercase; color: #5a6268; letter-spacing: .3px; }
.kv-list dd { margin: 0 0 .75rem; font-size: 1rem; color: var(--ink); }

/* ---------- FORMULÁRIO: rótulo ACIMA, borda completa, 40px ---------- */
body.admin .form-group { position: relative; margin-bottom: 1.25rem; }
body.admin .form-group > label, body.admin label.control-label {
  font-weight: 500; color: var(--ink); margin-bottom: .5rem; display: inline-flex; align-items: center;
  min-height: 1.5rem; font-size: 13.5px;
}
body.admin .form-group.required > label abbr, body.admin abbr[title="required"] {
  color: #dc3545; margin-left: .25rem; font-size: 1rem; border: 0; text-decoration: none;
}
body.admin .form-control, body.admin select.form-control {
  width: 100%; height: 40px; padding: .5rem 1rem; border: 1px solid var(--input-border); border-radius: var(--radius-input);
  background: #fff; color: var(--ink); font-size: 13.5px; font-family: inherit; line-height: 1.4; box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
body.admin textarea.form-control { height: auto; min-height: 96px; }
body.admin .form-control:hover { background: #f5f5f5; }
body.admin .form-control:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 2px var(--p); background: #fff; }
body.admin .form-control[disabled], body.admin .form-control[readonly] { background: #efefef; color: #777; }
body.admin .help-block { display: block; margin: .35rem 0 0; color: var(--note); font-size: 12px; }
body.admin .has-error .form-control { border-color: var(--error-text); }
body.admin .has-error .help-block, body.admin .has-error .control-label { color: var(--error-text); }
body.admin input[type="file"] { font-size: 13px; padding: .4rem 0; }
.form-section { margin-top: .5rem; }
.form-section__title {
  font-size: 1.05rem; font-weight: 600; color: var(--heading); margin: 0 0 1rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--card-ring); display: flex; align-items: center; gap: .5rem;
}
.form-section__title .ui-icon { color: var(--p); }
.formfoot { margin-top: .5rem; display: flex; justify-content: flex-end; gap: .5rem; margin-bottom: 1.5rem; }

/* checkbox e radio: quadrado/círculo com a cor de marca */
body.admin .checkbox, body.admin .radio { margin: 0 0 .5rem; min-height: 0; }
body.admin .checkbox label, body.admin .radio label { padding-left: 0; display: inline-flex; align-items: center; gap: .6rem; font-weight: 400; cursor: pointer; min-height: 1.5rem; }
body.admin input[type="checkbox"], body.admin input[type="radio"] {
  appearance: none; -webkit-appearance: none; margin: 0; width: 1.25rem; height: 1.25rem; flex-shrink: 0;
  border: 1px solid var(--input-border); background: #fff; cursor: pointer; position: relative; vertical-align: middle;
}
body.admin input[type="radio"] { border-radius: 50%; }
body.admin input[type="checkbox"] { border-radius: 4px; }
body.admin input[type="checkbox"]:checked, body.admin input[type="radio"]:checked { background: var(--p); border-color: var(--p); }
body.admin input[type="checkbox"]:checked:after {
  content: ''; position: absolute; left: .3rem; top: .08rem; width: .45rem; height: .8rem;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg);
}
body.admin input[type="radio"]:checked:after {
  content: ''; position: absolute; left: .3rem; top: .3rem; width: .5rem; height: .5rem; border-radius: 50%; background: #fff;
}
body.admin input[type="checkbox"]:focus-visible, body.admin input[type="radio"]:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }
/* booleano de formulário vira interruptor (2.75rem x 1.5rem) */
body.admin .form-group.boolean .checkbox label { gap: .75rem; }
body.admin .form-group.boolean input[type="checkbox"] {
  width: 2.75rem; height: 1.5rem; border-radius: 1.5rem; background: #ced4da; border: 0; transition: background .2s;
}
body.admin .form-group.boolean input[type="checkbox"]:after {
  content: ''; position: absolute; top: .1875rem; left: .1875rem; width: 1.125rem; height: 1.125rem; border: 0;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); transform: none; transition: transform .2s;
}
body.admin .form-group.boolean input[type="checkbox"]:checked { background: var(--p); }
body.admin .form-group.boolean input[type="checkbox"]:checked:after { transform: translateX(1.25rem); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem 1rem; }
.checkbox-grid .checkbox { margin: 0; }

/* select2 / chosen / summernote / datepicker dentro do padrão */
body.admin .select2-container .select2-choice, body.admin .select2-container-multi .select2-choices,
body.admin .chosen-container-single .chosen-single, body.admin .chosen-container .chosen-choices {
  height: 40px; line-height: 38px; border: 1px solid var(--input-border); border-radius: var(--radius-input);
  background: #fff; box-shadow: none; background-image: none; font-family: inherit; color: var(--ink); padding-left: .75rem;
}
body.admin .select2-container-multi .select2-choices, body.admin .chosen-container .chosen-choices { height: auto; min-height: 40px; line-height: 1.4; padding: 4px 6px; }
body.admin .select2-container .select2-choice .select2-arrow { background: none; border: 0; }
body.admin .select2-container-active .select2-choice, body.admin .chosen-container-active .chosen-single { border-color: var(--p); box-shadow: 0 0 0 2px var(--p); }
body.admin .select2-results .select2-highlighted { background: var(--p); }
body.admin .select2-container-multi .select2-choices .select2-search-choice { background: var(--p); color: #fff; border: 0; border-radius: var(--radius-md); }
body.admin .note-editor.note-frame { border: 1px solid var(--input-border); border-radius: var(--radius-input); }
body.admin .note-editor .note-toolbar { background: #fafafa; border-radius: var(--radius-input) var(--radius-input) 0 0; }
body.admin .note-editor .note-btn { height: auto; font-size: 12px; border-color: #ddd; border-width: 1px; border-radius: 4px; }
body.admin .datepicker td.active, body.admin .datepicker td.active:hover { background: var(--p); }

/* ---------- ESTADOS: alertas, toasts, vazio ---------- */
body.admin .alert { padding: 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; border: 1px solid; text-shadow: none; }
body.admin .alert-danger { color: #842029; background: #f8d7da; border-color: #f5c2c7; }
body.admin .alert-info { color: #0c5460; background: #d1ecf1; border-color: #b6d4da; }
body.admin .alert-success { color: #155724; background: #d4edda; border-color: #c3e6cb; }
body.admin .alert-warning { color: #664d03; background: #fff3cd; border-color: #ffecb5; }
body.admin .alert h4, body.admin .alert .alert-heading { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; color: inherit; }
body.admin .alert ul, body.admin .alert ol { margin: 0; padding-left: 1.2rem; }
body.admin .alert .row-i { display: flex; gap: 1rem; }
body.admin .alert .row-i .ic { flex-shrink: 0; margin-top: .15rem; display: flex; }
.toast-container { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 1100; display: flex; flex-direction: column; gap: .75rem; align-items: flex-end; max-width: calc(100vw - 32px); }
.toast {
  min-width: 320px; max-width: 480px; border-radius: var(--radius-md); color: #fff; border: 0; box-shadow: 0 5px 20px rgba(0, 0, 0, .15);
  display: flex; align-items: center; justify-content: space-between; animation: toast-in .25s ease;
}
.toast.bg-success { background: var(--success); }
.toast.bg-danger { background: var(--error); }
.toast.bg-warning { background: var(--warning); color: #333; }
.toast.bg-info { background: var(--info); }
.toast .toast-body { padding: 1rem 1.2rem; font-size: .95rem; line-height: 1.4; }
.toast .x { background: none; border: 0; color: inherit; opacity: .8; font-size: 22px; cursor: pointer; padding: 0 1rem; line-height: 1; align-self: stretch; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.empty-state { text-align: center; color: var(--note); padding: 3rem 1rem; }
.empty-state .ui-icon { width: 40px; height: 40px; opacity: .4; margin-bottom: .75rem; }
.empty-state p { margin: 0; }

/* ---------- MODAL ---------- */
body.admin .modal-content { border-radius: var(--radius-card); border: 0; box-shadow: 0 5px 20px rgba(0, 0, 0, .12); font-family: inherit; }
body.admin .modal-header { padding: 1rem 1.2rem; border-bottom: 1px solid #dee2e6; display: flex; align-items: center; justify-content: space-between; }
body.admin .modal-header .close { margin: 0; font-size: 26px; line-height: 1; color: var(--note); opacity: 1; text-shadow: none; order: 2; }
body.admin .modal-title { margin: 0; font-size: 1.2rem; font-weight: 500; color: var(--heading); }
body.admin .modal-body { padding: 1.2rem; }
body.admin .modal-footer { padding: .8rem 1.2rem 1.2rem; border-top: 0; display: flex; justify-content: flex-end; gap: .5rem; }
body.admin .modal-footer .btn + .btn { margin-left: 0; }
body.admin .modal-backdrop.in { opacity: .2; }

/* ---------- DASHBOARD ---------- */
.dashboard-welcome-card {
  display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: var(--radius-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .07); border: 1px solid #f0f0f0; padding: 1rem 1.5rem; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.dwc__left { display: flex; flex-direction: column; gap: .3rem; }
.dwc__actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.dwc__greeting { font-size: 1.6rem; font-weight: 400; color: #212529; line-height: 1.2; }
.dwc__greeting strong { font-weight: 700; }
.dwc__date { font-size: .95rem; color: var(--note); display: flex; align-items: center; gap: .4rem; }
.dwc__date .ui-icon { width: 18px; height: 18px; }
.dashboard-section-header { border-bottom: 1px solid #e9ecef; padding-bottom: .75rem; margin-bottom: 1.25rem; }
.dashboard-section-label { font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #495057; display: inline-flex; align-items: center; gap: .5rem; margin: 0; }
.dashboard-section-label .ui-icon { opacity: .8; width: 22px; height: 22px; color: var(--p); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 2rem; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--card-bg); color: var(--heading); border-radius: 10px; border-left: 5px solid var(--p);
  box-shadow: 0 0 0 1px var(--card-ring), 0 2px 4px rgba(0, 0, 0, .04); padding: 1.5rem 1.75rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 100%; min-height: 136px;
  transition: transform .15s, box-shadow .15s;
}
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--card-ring), 0 6px 16px rgba(0, 0, 0, .1); text-decoration: none; color: var(--heading); }
.sc__number { font-size: 2.6rem; font-weight: 700; line-height: 1.1; margin-bottom: .4rem; color: var(--heading); }
.sc__label { font-size: .95rem; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; color: #495057; }
.sc__hint { font-size: .9rem; color: var(--note); margin-top: .35rem; text-transform: none; letter-spacing: 0; }
.sc__icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%; background: var(--p-light); color: var(--p); }
.sc__icon .ui-icon { width: 32px; height: 32px; }

/* ---------- LOGIN ---------- */
/* login: body leva `admin auth` para herdar fonte, campos e botões */
body.auth { background: #F3F3F3; min-height: 100vh; position: relative; overflow-x: hidden; }
.login-bg { position: relative; display: flex; align-items: center; justify-content: center; padding: 3rem 1rem; min-height: 100vh; }
.login-bg::before { content: ''; position: absolute; top: 0; right: -20vw; width: 20vw; height: 100vh; background: var(--p); transform: skewX(-20deg); transform-origin: top right; z-index: 0; }
@media (max-width: 575px) { .login-bg::before { display: none; } }
.login-card { position: relative; z-index: 1; background: #fff; border-radius: var(--radius-card); box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075); width: 100%; max-width: 420px; }
.login-card .bd { padding: 1.5rem 2rem 2rem; }
.session_logo { text-align: center; margin-bottom: 1.5rem; }
.session_logo img { height: 48px; margin-bottom: .75rem; }
.session_logo h1 { font-weight: 700; font-size: 22px; line-height: 1.1; margin: 0; color: var(--heading); }
.session_logo h1 small { font-size: 13px; font-weight: 500; color: var(--muted); display: block; margin-top: 4px; }
.login-card .form-group.boolean label { font-size: 13px; }
.link-action { font-weight: 600; line-height: 1; text-decoration: underline; text-underline-offset: 2px; color: var(--p); font-size: 13px; }
body.admin .btn-auth { display: flex; min-width: 155px; margin: 1.25rem auto 0; font-weight: 700; padding: 0 2rem; }
.auth-links { margin-top: 1.25rem; text-align: center; display: flex; flex-direction: column; gap: .5rem; }
body.auth .alert { border-radius: var(--radius-md); }

/* ---------- Diversos ---------- */
.map-box { border-radius: 6px; border: 1px solid #dee2e6; overflow: hidden; }
#map { z-index: 0; }
.upload-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem;
  border: 2px dashed #ccc; border-radius: 8px; background: #fff; min-height: 120px; text-align: center; cursor: pointer; margin-bottom: 1rem;
}
.upload-card:hover { border-color: var(--p); background: var(--p-soft); }
body.admin .dropzone { border: 2px dashed #ccc; border-radius: 8px; background: #fff; }
body.admin .dropzone:hover { border-color: var(--p); background: var(--p-soft); }
.rating-big { font-size: 1.4rem; }
.text-note { color: var(--note); }
.t-primary { color: var(--p); }
.charcount { display: block; text-align: right; font-size: 12px; color: var(--note); margin-top: 4px; }
.charcount.is-over { color: var(--error-text); font-weight: 600; }
details.collapsible > summary { cursor: pointer; font-weight: 500; color: var(--p); list-style: none; display: inline-flex; align-items: center; gap: .4rem; }
details.collapsible > summary::-webkit-details-marker { display: none; }
.review-item { border-bottom: 1px solid var(--card-ring); padding: .75rem 0; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.review-item__stars { color: #F2AE38; font-size: 1rem; letter-spacing: 1px; }

/* ---------- Alterações no registro (PaperTrail) ---------- */
.record-changes__toggle {
  background: none; border: 0; color: var(--ink); display: inline-flex; padding: 6px; border-radius: 6px; cursor: pointer;
}
.record-changes__toggle:hover { color: var(--p); background: rgba(0, 0, 0, .06); }
.record-changes__toggle .ui-icon { transition: transform .15s; }
.record-changes__toggle[aria-expanded="true"] .ui-icon { transform: rotate(90deg); }
.record-changes__row { cursor: pointer; }
body.admin .record-changes__table > tbody > tr:nth-child(odd), body.admin .record-changes__table > tbody > tr:nth-child(even) { background: transparent; }
body.admin .record-changes__table > tbody:nth-of-type(odd) > tr.record-changes__row { background: var(--card-ring); }
body.admin .record-changes__table > tbody:nth-of-type(even) > tr.record-changes__row { background: var(--card-bg); }
body.admin .record-changes__table > tbody > tr.record-changes__row:hover { background: rgba(0, 0, 0, .04); }
body.admin .record-changes__table > tbody > tr.record-changes__details > td { background: #fff; padding: 1rem 1.25rem 1.25rem 3.5rem; }
.record-changes__diff { width: 100%; border-collapse: collapse; font-size: .95rem; }
.record-changes__diff th, .record-changes__diff td { padding: .5rem .75rem; border-bottom: 1px solid var(--card-ring); text-align: left; vertical-align: top; }
.record-changes__diff thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; color: #5a6268; }
.record-changes__diff tbody th { font-weight: 600; color: var(--heading); width: 28%; }
.record-changes__old { color: var(--error-text); }
.record-changes__new { color: var(--success-text); }
.version-author { border-bottom: 1px dotted #adb5bd; cursor: help; }

/* ---------- Busca global no topo ---------- */
.gsearch { position: relative; flex: 1; max-width: 480px; margin: 0 1.5rem; }
.gsearch input {
  width: 100%; height: 42px; padding: 0 84px 0 16px; border: 1px solid rgba(255, 255, 255, .35);
  border-radius: var(--radius-input); background: rgba(255, 255, 255, .15); color: #fff; font-size: 14px; font-family: inherit;
}
.gsearch input::placeholder { color: rgba(255, 255, 255, .8); }
.gsearch input:focus { outline: none; background: rgba(255, 255, 255, .25); border-color: #fff; }
.gsearch .mag { position: absolute; right: 52px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .9); display: flex; background: none; border: 0; padding: 4px; }
.gsearch kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 4px; padding: 2px 6px; color: #fff; font-family: inherit; background: none; box-shadow: none; }
.app-switch__btn img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; background: #fff; }
.search-results .card-header h4 { font-size: 1.1rem; }
.search-results__list { list-style: none; margin: 0; padding: 0; }
.search-results__list li { border-bottom: 1px solid var(--card-ring); }
.search-results__list a { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.4rem; color: var(--ink); }
.search-results__list a:hover { background: rgba(0, 0, 0, .03); color: var(--p); text-decoration: none; }
.search-results__list small { color: var(--note); margin-left: auto; white-space: nowrap; }

/* ---------- Lateral: conta e e-mail ---------- */
.user__email { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; max-width: 160px; }
.user__name { word-break: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.user__info > div { min-width: 0; }

/* ---------- Listagem: ordenação, abas com contagem, filtros ativos, vazio ---------- */
body.admin .table th a.is-sorted { color: var(--p); }
body.admin .table th a.is-sorted .ui-icon { opacity: 1; }
.filter-tab__badge { margin-left: 2px; }
.active-filters-bar { background: #f8f9fa; border-radius: var(--radius-input); padding: .6rem 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.active-filters-label { font-size: .9rem; font-weight: 600; color: #495057; display: inline-flex; align-items: center; gap: .4rem; }
.active-filters-label .ui-icon { color: var(--p); }
.active-filter-pill { display: inline-flex; align-items: center; background: #fff; border: 1px solid #e9ecef; border-radius: var(--radius-input); padding: .3rem .25rem .3rem .65rem; font-size: .9rem; color: #495057; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); gap: .35rem; }
.active-filter-pill b { font-weight: 600; color: var(--p); }
.filter-remove-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #f1f3f5; color: #6c757d; }
.filter-remove-btn:hover { background: #e9ecef; color: var(--error-text); text-decoration: none; }
.clear-all-filters { margin-left: auto; font-size: .85rem; color: #6c757d; display: inline-flex; align-items: center; gap: .3rem; }
.clear-all-filters:hover { color: var(--error-text); text-decoration: none; }
.empty-row td .btn { margin-top: .75rem; }
body.admin .table td.title-cell a { color: var(--heading); font-weight: 600; }
body.admin .table td.title-cell a:hover { color: var(--p); }

/* ---------- Formulário: rodapé fixo, hints, upload de imagem ---------- */
body.admin .help-block { font-size: 13px; }
.formfoot { position: sticky; bottom: 0; z-index: 5; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--card-ring); padding: .9rem 0; margin: .5rem -4px 1.5rem; }
.image-upload { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.image-upload__preview { width: 120px; height: 120px; border-radius: 8px; object-fit: cover; border: 1px solid var(--card-ring); background: #fff; }
.image-upload__preview--empty { display: flex; align-items: center; justify-content: center; color: #adb5bd; border-style: dashed; }
.image-upload__drop { flex: 1; min-width: 220px; border: 2px dashed #ccc; border-radius: 8px; padding: 1.25rem; text-align: center; background: #fff; cursor: pointer; }
.image-upload__drop:hover, .image-upload__drop.is-over { border-color: var(--p); background: var(--p-soft); }
.image-upload__drop input[type="file"] { display: none; }
.image-upload__drop .main-text { font-size: 15px; font-weight: 500; margin: 0 0 .25rem; color: var(--heading); }
.image-upload__drop .sub-text { font-size: 13px; color: #6c757d; margin: 0; }
.image-upload__drop .ui-icon { width: 28px; height: 28px; color: #6c757d; margin-bottom: .5rem; }
.image-upload__name { display: block; margin-top: .5rem; font-size: 13px; color: var(--p); font-weight: 500; }
body.admin input[type="color"] { width: 56px; height: 40px; padding: 2px 4px; border: 1px solid var(--input-border); border-radius: var(--radius-input); background: #fff; cursor: pointer; }
.color-input-group { display: flex; align-items: center; gap: .75rem; }
.color-input-group .form-control { max-width: 160px; }

/* ---------- Detalhe: texto corrido, rodapé legível ---------- */
.show-value { max-width: 72ch; }
.card-footer { color: #6c757d; }

/* ---------- Álbum ---------- */
.thumb--fallback { align-items: center; justify-content: center; color: #adb5bd; border: 1px solid var(--card-ring); }
body.admin .dropzone .dz-preview .dz-remove {
  display: inline-flex; align-items: center; justify-content: center; margin-top: .5rem; height: 30px; padding: 0 12px;
  border: 2px solid var(--p); border-radius: var(--radius-md); color: var(--p); font-size: 12px; font-weight: 500; text-decoration: none; background: #fff;
}
body.admin .dropzone .dz-preview .dz-remove:hover { background: var(--p); color: #fff; }
.copy-url { display: inline-flex; align-items: center; gap: .3rem; }
.copy-url.is-copied { color: var(--success-text); }

/* ---------- Dashboard: hoje e atividade recente ---------- */
.dash-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1.25rem; align-items: start; margin-bottom: 2rem; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.sc__arrow { display: flex; color: #adb5bd; margin-left: -.5rem; }
a.stat-card:hover .sc__arrow { color: var(--p); }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li { display: flex; align-items: center; gap: 1rem; padding: .75rem 1.4rem; border-bottom: 1px solid var(--card-ring); }
.today-list__time { font-weight: 700; color: var(--heading); min-width: 52px; font-size: 1.05rem; }
.today-list__title a { font-weight: 600; color: var(--heading); }
.today-list__place { color: var(--note); font-size: .9rem; display: block; }
.actlist { list-style: none; margin: 0; padding: 0; }
.actlist li { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem 1.4rem; border-bottom: 1px solid var(--card-ring); }
.actlist .av { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.actlist .av--create { background: var(--success-text); }
.actlist .av--update { background: var(--info-text); }
.actlist .av--destroy { background: var(--error-text); }
.actlist .tx { font-size: .95rem; line-height: 1.4; color: #212529; }
.actlist .tx a { color: var(--heading); font-weight: 600; }
.actlist .mt { color: var(--note); margin-top: .15rem; font-size: .85rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* ---------- Reordenar linhas (alça + ↑/↓) ---------- */
.reorder-hint { display: flex; align-items: center; gap: .4rem; color: var(--note); font-size: .9rem; margin: -.25rem 0 .9rem; }
.reorder-hint .ui-icon { color: var(--p); }
body.admin .table th.reorder-cell { width: 1%; white-space: nowrap; }
body.admin .table td.reorder-cell { width: 1%; white-space: nowrap; }
.reorder-cell { display: table-cell; }
.reorder-cell > * { vertical-align: middle; }
.reorder-handle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: #adb5bd; cursor: grab; }
.reorder-handle:hover { color: var(--p); background: rgba(0, 0, 0, .06); }
.reorder-handle:active { cursor: grabbing; }
.reorder-position { display: inline-block; min-width: 28px; text-align: center; font-weight: 700; color: var(--heading); margin: 0 .25rem; }
.reorder-arrows { display: inline-flex; flex-direction: column; gap: 1px; vertical-align: middle; }
.reorder-form { display: inline; margin: 0; }
.reorder-arrow { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 18px; border: 0; background: none; color: var(--ink); border-radius: 4px; padding: 0; cursor: pointer; }
.reorder-arrow:hover { color: var(--p); background: rgba(0, 0, 0, .06); }
.reorder-arrow[disabled] { opacity: .25; cursor: default; background: none; color: var(--ink); }
body.admin .table--reorderable > tbody > tr.is-dragging { opacity: .45; outline: 2px dashed var(--p); outline-offset: -2px; }
/* árvore do menu: cabeçalho do menu interno + itens indentados */
body.admin .table--menu-tree > tbody > tr.menu-group-row,
body.admin .table--menu-tree > tbody > tr.menu-group-row:hover { background: #fff; border-top: 2px solid var(--card-ring); }
body.admin .table--menu-tree > tbody > tr.menu-group-row > td { padding-top: .9rem; padding-bottom: .6rem; border-bottom: 0; }
.menu-group-row__title { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--heading); font-size: .95rem; }
.menu-group-row__title .ui-icon { color: var(--p); }
.menu-group-row__title small { font-weight: 400; font-size: .78rem; }
body.admin .table--menu-tree > tbody > tr.menu-tree-child > td.title-cell { padding-left: 2rem; }
body.admin .table--menu-tree > tbody > tr.menu-tree-child > td:first-child { box-shadow: inset 4px 0 0 var(--p-light); }
.menu-tree-child__indent { display: inline-flex; color: #adb5bd; margin-right: .25rem; vertical-align: middle; }
body.admin .table--reorderable > tbody > tr[draggable="true"] { cursor: grabbing; }

/* ---------- Seleção em lote (atrações) ---------- */
.bulk-cell { width: 1%; }
.bulk-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .6rem 1rem; margin-bottom: 1rem;
  background: var(--p-soft); border: 1px solid var(--p-light); border-radius: var(--radius-input); }
.bulk-bar[hidden] { display: none; }
.bulk-bar__count { margin-right: .5rem; color: var(--heading); }
.actions-column__btn { color: var(--ink); display: inline-flex; padding: 6px; margin: 0 1px; border-radius: 6px; background: none; border: 0; cursor: pointer; }
.actions-column__btn:hover { color: var(--p); background: rgba(0, 0, 0, .06); }

/* ---------- Alertas do painel inicial ---------- */
.dashboard-alerts { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.dashboard-alert { display: inline-flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-radius: var(--radius-md);
  background: #fff8e6; border: 1px solid #ffe2a1; color: #664d03; font-size: .95rem; }
.dashboard-alert:hover { background: #fff1cc; color: #664d03; text-decoration: none; }
.dashboard-alert__icon { color: var(--warning-text); display: flex; }

/* ---------- Perfis de acesso (usuários) ---------- */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.role-option { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--input-border); border-radius: var(--radius-md); background: #fff; cursor: pointer; font-weight: 400; margin: 0; }
.role-option:hover { border-color: var(--p); }
.role-option.is-checked { border-color: var(--p); background: var(--p-soft); box-shadow: 0 0 0 1px var(--p); }
.role-option input[type="checkbox"] { margin-top: .15rem; }
.role-option__body { display: flex; flex-direction: column; gap: .15rem; }
.role-option__name { font-weight: 600; color: var(--heading); }
.role-option__desc { font-size: .85rem; color: var(--note); line-height: 1.35; }

/* ---------- Abas de idioma (conteúdo traduzido) ---------- */
.locale-tabs__nav { border-bottom: 1px solid #dee2e6; margin-bottom: 1.25rem; display: flex; gap: 2px; }
body.admin .locale-tabs__nav > li > a {
  display: inline-flex; align-items: center; gap: .5rem; padding: 10px 16px; margin: 0; border: 1px solid transparent;
  border-bottom: 0; border-radius: 8px 8px 0 0; color: #64748b; font-weight: 500; font-size: 14px; background: #f8f9fa;
}
body.admin .locale-tabs__nav > li > a:hover { background: #e2e8f0; color: #475569; border-color: #e2e8f0; }
body.admin .locale-tabs__nav > li.active > a, body.admin .locale-tabs__nav > li.active > a:hover {
  background: #fff; color: var(--heading); border-color: #dee2e6; border-bottom-color: #fff; margin-bottom: -1px; position: relative; z-index: 1;
}
.locale-tabs__state { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; border-radius: 9px; font-size: 11px; color: #94a3b8; background: #e9ecef; padding: 0 5px; }
.locale-tabs__state--filled { background: var(--success-text); color: #fff; }
.locale-tabs__content > .tab-pane { display: none; }
.locale-tabs__content > .tab-pane.active { display: block; }
.locale-badge { font-family: inherit; }
.locale-badge--missing { opacity: .55; }

/* ---------- Mobile: coluna de ações fixa, toolbar empilhada ---------- */
@media (max-width: 991px) {
  body.admin .table .actions-column { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 2px 0 4px rgba(0, 0, 0, .06); }
  body.admin .table > tbody > tr:nth-child(odd) .actions-column { background: var(--card-ring); }
  body.admin .table > tbody > tr:nth-child(even) .actions-column { background: var(--card-bg); }
  .toolbar-stack { flex-direction: column; align-items: stretch; }
  .toolbar-stack .search-form, .toolbar-stack .btn-main { max-width: none; width: 100%; }
  .toolbar-stack__spacer { display: none; }
  .filter-tabs { display: flex; width: 100%; }
  .filter-tab { flex: 1; justify-content: center; padding: 10px 8px 12px; }
  .status-filters { padding-left: 0; }
  .gsearch { display: none; }
  .dwc__actions { width: 100%; }
  .dwc__actions .btn { flex: 1; }
}
body.admin .popover { font-family: inherit; max-width: 480px; border-radius: var(--radius-md); }
body.admin .popover dl { margin: 0; }

/* ---------- Responsivo: lateral vira gaveta ---------- */
@media (max-width: 991px) {
  .header { padding: 0 1rem; }
  .header__toggle { display: inline-flex; }
  .app-switch__label { display: none; }
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 24px rgba(0, 0, 0, .2); }
  body.sidebar-open .sidebar__backdrop { display: block; }
  .content { padding-left: 16px; padding-right: 16px; }
  .content__inner { padding-left: 0; }
  .content__title h1 { font-size: 1.4rem; }
  .content__title .pagination-center { order: 3; width: 100%; justify-content: flex-start; }
}
@media (max-width: 575px) {
  .header__brand h1, .header__env { display: none; }
  .header__brand img { height: 32px; }
  .app-switch__btn { max-width: 150px; }
  .toast { min-width: 0; width: 100%; }
}
