/* Painel do administrador: mesma identidade do painel das revendas. */
#adm-app {
  --adm-accent: #e8333a;
  --adm-accent-strong: #c4232a;
  --adm-accent-soft: rgba(232, 51, 58, .14);
  --adm-accent-text: #ff8a8e;
  --adm-text: #eef1f7;
  --adm-muted: #9aa4b8;
  --adm-line: #262d3d;
  --adm-line-strong: #353e52;
  --adm-surface: #121725;
  --adm-surface-2: #181e2f;
  --adm-ok: #34d399;
  --adm-ok-soft: rgba(52, 211, 153, .13);
  --adm-warn: #fbbf24;
  --adm-warn-soft: rgba(251, 191, 36, .13);
  color: var(--adm-text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
#adm-app *, #adm-app *::before, #adm-app *::after { box-sizing: border-box; }
/* :where não soma peso: as classes .adm-* abaixo continuam valendo sobre estes padrões. */
:where(#adm-app) :where(h1, h2, h3, p) { margin: 0; }
:where(#adm-app) :where(button, input) { font: inherit; color: inherit; }
:where(#adm-app) button { cursor: pointer; }
#adm-app :focus-visible { outline: 2px solid var(--adm-accent-text); outline-offset: 2px; }
#adm-app .mono { font-family: ui-monospace, Consolas, "Courier New", monospace; letter-spacing: .3px; }
body.adm-locked { overflow: hidden; }

/* Cabeçalho */
.adm-top { position: sticky; top: 0; z-index: 20; background: rgba(9, 12, 21, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--adm-line); }
.adm-top-in { display: flex; align-items: center; gap: 14px; height: 68px; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.adm-logo { display: flex; align-items: center; gap: 10px; margin-right: auto; font-weight: 800; font-size: 20px; letter-spacing: 1px; }
.adm-logo img { width: 34px; height: 34px; }
.adm-logo small { padding-left: 10px; border-left: 1px solid var(--adm-line-strong); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--adm-muted); }
.adm-account { position: relative; }
.adm-avatar { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border-radius: 50%; background: var(--adm-surface-2); border: 1px solid var(--adm-line-strong); font-weight: 700; font-size: 15px; }
.adm-menu { position: absolute; top: 52px; right: 0; z-index: 30; width: 270px; padding: 8px; background: #121725; border: 1px solid var(--adm-line-strong); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.adm-menu-head { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--adm-line); }
.adm-menu-head strong { display: block; }
.adm-menu-head span { display: block; font-size: 14px; color: var(--adm-muted); overflow-wrap: anywhere; }
.adm-menu-item { display: block; width: 100%; min-height: 42px; padding: 8px 10px; text-align: left; background: none; border: 0; border-radius: 8px; font-weight: 600; }
.adm-menu-item:hover { background: var(--adm-surface-2); }

/* Menu lateral */
.adm-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.adm-side { position: sticky; top: 68px; align-self: start; display: grid; gap: 4px; padding: 22px 14px; }
.adm-side-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 14px; text-align: left; background: none; border: 0; border-radius: 10px; color: var(--adm-muted) !important; font-weight: 600; }
.adm-side-btn svg { width: 21px; height: 21px; flex: none; }
.adm-side-btn:hover { color: var(--adm-text) !important; background: var(--adm-surface); }
.adm-side-btn.on { color: var(--adm-text) !important; background: var(--adm-accent-soft); box-shadow: inset 3px 0 0 var(--adm-accent); }
.adm-short { display: none; }
.adm-main { min-width: 0; padding: 24px 20px 48px; }
.adm-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-bottom: 10px; font-size: 14px; color: var(--adm-muted); }
.adm-crumbs button { min-height: 32px; padding: 0; background: none; border: 0; color: var(--adm-accent-text) !important; font-size: 14px; font-weight: 600; text-decoration: underline; }
.adm-crumbs b { font-weight: 600; color: var(--adm-text); overflow-wrap: anywhere; }
.adm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.adm-head h1 { margin-right: auto !important; font-size: 26px; line-height: 1.2; }

/* Campos e botões */
.adm-input { width: 100%; min-height: 50px; padding: 11px 14px; font-size: 16px; background: #0c101c; border: 1px solid var(--adm-line-strong); border-radius: 10px; }
.adm-input::placeholder { color: #6d7689; }
.adm-input:focus { outline: none; border-color: var(--adm-accent); box-shadow: 0 0 0 3px var(--adm-accent-soft); }
.adm-search { margin-bottom: 12px; }
.adm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 11px 20px; font-size: 16px; font-weight: 700; text-align: center; background: var(--adm-surface-2); border: 1px solid var(--adm-line-strong); border-radius: 14px; }
.adm-btn:hover { border-color: var(--adm-muted); }
.adm-btn.primary { background: var(--adm-accent); border-color: var(--adm-accent); color: #fff !important; box-shadow: 0 8px 24px rgba(232, 51, 58, .25); }
.adm-btn.primary:hover { background: var(--adm-accent-strong); border-color: var(--adm-accent-strong); }
.adm-btn.confirm { background: var(--adm-accent-soft); border-color: var(--adm-accent); color: var(--adm-accent-text) !important; }
.adm-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.adm-btn.block { display: flex; width: 100%; }
.adm-btn.sm { min-height: 40px; padding: 7px 14px; font-size: 14px; border-radius: 10px; }
.adm-link { padding: 0; background: none; border: 0; color: var(--adm-accent-text) !important; font-weight: 600; text-decoration: underline; }
.adm-field { display: block; margin-top: 16px; }
.adm-field-first { margin-top: 0; }
.adm-field > span { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.adm-field > span em { font-style: normal; font-weight: 400; color: var(--adm-muted); }
.adm-hint { margin-top: 8px !important; font-size: 13px; color: var(--adm-muted); }
.adm-muted { color: var(--adm-muted); }
.adm-stack { display: grid; gap: 8px; }
.adm-mt { margin-top: 12px; }
.adm-mt-s { margin-top: 12px; }
.adm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* Filtros, números e situação */
.adm-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.adm-filter { min-height: 40px; padding: 6px 14px; background: transparent; border: 1px solid var(--adm-line-strong); border-radius: 999px; color: var(--adm-muted) !important; font-size: 14px; font-weight: 600; }
.adm-filter:hover { color: var(--adm-text) !important; }
.adm-filter.on { background: var(--adm-accent-soft); border-color: rgba(232, 51, 58, .55); color: var(--adm-text) !important; }
.adm-hint + .adm-stats { margin-top: 12px; }
.adm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.adm-stat { padding: 12px 14px; background: var(--adm-surface); border: 1px solid var(--adm-line); border-radius: 14px; }
.adm-stat b { display: block; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.adm-stat span { font-size: 13px; color: var(--adm-muted); }
.adm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; font-size: 13px; font-weight: 700; white-space: nowrap; }
.adm-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.adm-chip.ok { color: var(--adm-ok); background: var(--adm-ok-soft); }
.adm-chip.warn { color: var(--adm-warn); background: var(--adm-warn-soft); }
.adm-chip.bad { color: var(--adm-accent-text); background: var(--adm-accent-soft); }
.adm-chip.none { color: var(--adm-muted); background: var(--adm-surface-2); border-color: var(--adm-line-strong); }

/* Linhas */
.adm-rows { display: grid; gap: 8px; }
.adm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; width: 100%; padding: 13px 16px; text-align: left; background: var(--adm-surface); border: 1px solid var(--adm-line); border-radius: 14px; }
.adm-row:hover { border-color: var(--adm-line-strong); }
.adm-row.sel { border-color: var(--adm-accent); box-shadow: 0 0 0 1px var(--adm-accent) inset; }
.adm-row-main { min-width: 0; }
.adm-row-name { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row-sub { display: block; font-size: 14px; color: var(--adm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row-side { text-align: right; }
.adm-row-date { display: block; margin-top: 3px; font-size: 13px; color: var(--adm-muted); white-space: nowrap; }
.adm-row-credits { min-width: 72px; text-align: right; font-size: 13px; color: var(--adm-muted); }
.adm-row-credits b { display: block; font-size: 20px; line-height: 1.15; color: var(--adm-text); }
.adm-row-credits.zero b { color: var(--adm-accent-text); }
.adm-note { padding: 28px 16px; text-align: center; color: var(--adm-muted); }
.adm-code { font-family: ui-monospace, Consolas, "Courier New", monospace; font-weight: 700; letter-spacing: .6px; overflow-wrap: anywhere; }
.adm-code-big { margin-top: 12px !important; font-size: 22px; }

/* Gaveta */
.adm-drawer-back { position: fixed; inset: 0; z-index: 40; background: rgba(4, 6, 12, .65); }
.adm-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(460px, 100%); padding: 22px; overflow-y: auto; overscroll-behavior: contain; background: #121725; border-left: 1px solid var(--adm-line-strong); }
.adm-d-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.adm-d-head h2 { min-width: 0; margin-right: auto !important; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.adm-d-close { flex: none; width: 40px; height: 40px; padding: 0; background: var(--adm-surface-2); border: 1px solid var(--adm-line-strong); border-radius: 50%; font-size: 18px; line-height: 1; }
.adm-d-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--adm-line); }
.adm-d-block h3 { margin-bottom: 8px !important; font-size: 15px; }
.adm-d-info { display: grid; gap: 7px; margin-top: 12px; font-size: 15px; }
.adm-d-info div { display: flex; justify-content: space-between; gap: 14px; }
.adm-d-info span { flex: none; color: var(--adm-muted); }
.adm-d-info b { min-width: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.adm-stepper { display: grid; grid-template-columns: 50px minmax(0, 1fr) 50px; gap: 8px; }
.adm-stepper .adm-btn { padding: 6px; }
.adm-stepper input { padding: 6px; text-align: center; font-size: 22px; font-weight: 800; }
.adm-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.adm-quick button { flex: 1 1 auto; min-height: 40px; padding: 5px 10px; background: var(--adm-surface-2); border: 1px solid var(--adm-line-strong); border-radius: 10px; font-size: 14px; font-weight: 700; }
.adm-quick button:hover { border-color: var(--adm-accent); }
.adm-mini { display: grid; gap: 6px; font-size: 14px; }
.adm-mini > div { display: flex; justify-content: space-between; gap: 12px; }
.adm-mini b { flex: none; }
.adm-mini .plus { color: var(--adm-ok); }
.adm-mini .minus { color: var(--adm-accent-text); }
.adm-sublist { display: grid; gap: 6px; }
.adm-sublist button { display: flex; justify-content: space-between; gap: 12px; width: 100%; min-height: 42px; padding: 8px 12px; text-align: left; background: var(--adm-surface-2); border: 1px solid var(--adm-line-strong); border-radius: 10px; font-size: 14px; }
.adm-sublist button:hover { border-color: var(--adm-muted); }
.adm-sublist b { flex: none; }
.adm-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.adm-switch { position: relative; flex: none; width: 50px; height: 28px; padding: 0; background: var(--adm-line-strong); border: 0; border-radius: 999px; }
.adm-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: left .15s; }
.adm-switch[aria-checked="true"] { background: var(--adm-ok); }
.adm-switch[aria-checked="true"]::after { left: 25px; }
.adm-plan { margin: 16px 0 12px; padding: 13px 16px; background: var(--adm-accent-soft); border: 1px solid rgba(232, 51, 58, .35); border-radius: 14px; }
.adm-plan strong { display: block; }
.adm-plan span { font-size: 14px; color: var(--adm-muted); }
.adm-more { margin-top: 14px; }
.adm-listbox { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.adm-listbox legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; }
.adm-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #0c101c; border: 1px solid var(--adm-line-strong); border-radius: 10px; }
.adm-seg button { min-height: 42px; padding: 6px 8px; background: none; border: 0; border-radius: 7px; color: var(--adm-muted) !important; font-size: 15px; font-weight: 600; }
.adm-seg button[aria-checked="true"] { background: var(--adm-accent); color: #fff !important; }
.adm-access { margin-top: 14px; padding: 13px 14px; background: var(--adm-ok-soft); border: 1px solid rgba(52, 211, 153, .4); border-radius: 14px; }
.adm-access strong { display: block; margin-bottom: 6px; }
.adm-access pre { margin: 0 0 10px; font: inherit; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
#adm-mac-status .rv-mac { margin-top: 10px; }

@media (max-width: 900px) {
  .adm-layout { display: block; }
  .adm-side { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 30; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 6px; background: #0c101c; border-top: 1px solid var(--adm-line-strong); }
  .adm-side-btn { flex-direction: column; justify-content: center; gap: 2px; min-height: 54px; padding: 5px 2px; font-size: 12px; line-height: 1.15; text-align: center; }
  .adm-side-btn.on { box-shadow: none; }
  .adm-long { display: none; }
  .adm-short { display: inline; }
  .adm-main { padding: 18px 16px 88px; }
}
@media (max-width: 640px) {
  .adm-top-in { height: 62px; padding: 0 16px; gap: 10px; }
  .adm-logo small { display: none; }
  .adm-head h1 { font-size: 23px; }
  .adm-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 14px; }
  .adm-row .adm-row-side { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; text-align: left; }
  .adm-row .adm-row-side:empty { display: none; }
  .adm-row .adm-row-credits { grid-column: 2; grid-row: 1; min-width: 0; }
  .adm-row-date { margin: 0; }
  .adm-stats { gap: 6px; }
  .adm-stat { padding: 10px; }
  .adm-stat b { font-size: 18px; }
  .adm-drawer { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) { #adm-app * { transition: none !important; } }
.adm-neg { margin: 0 0 10px !important; color: var(--adm-accent-text); }
