/* Painel administrativo. */
body.admin { background: var(--fundo-suave); }
.login { max-width: 400px; margin: 8vh auto; background: #fff; padding: 28px 24px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 32, 96, .12); text-align: center; }
.login img { width: 260px; max-width: 100%; height: auto; }
.login h1 { font-size: 1.15rem; margin: 14px 0 18px; }
.login form { display: grid; gap: 12px; text-align: left; }
.aviso { color: var(--vermelho); margin: 0; min-height: 1.2em; font-size: .9rem; }

.topo { background: var(--azul); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; gap: 10px; }
.marca b { display: block; font-size: 1.05rem; }
.marca small { opacity: .8; }
.menu { position: relative; display: flex; gap: 8px; }
.topo .botao { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.menu-lista { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border-radius: var(--raio); box-shadow: 0 8px 30px rgba(0, 0, 0, .2); min-width: 190px; padding: 6px; z-index: 50; display: grid; }
.menu-lista a, .menu-lista button { text-align: left; padding: 10px 12px; border: 0; background: none; color: var(--azul); text-decoration: none; cursor: pointer; border-radius: 6px; font-weight: 600; }
.menu-lista a:hover, .menu-lista button:hover { background: var(--fundo-suave); }

.abas { display: flex; gap: 2px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--linha-clara); padding: 0 8px; position: sticky; top: 0; z-index: 10; }
.abas button { border: 0; background: none; padding: 13px 14px; font-weight: 600; color: var(--texto-suave); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.abas button[aria-selected="true"] { color: var(--azul); border-bottom-color: var(--azul); }

.admin .pagina { max-width: 1180px; }
.barra { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.barra .busca { flex: 1 1 260px; }
.lista { width: 100%; border-collapse: collapse; background: #fff; font-size: .9rem; min-width: 760px; }
.lista th, .lista td { padding: 9px 10px; border-bottom: 1px solid var(--linha-clara); text-align: left; vertical-align: middle; }
.lista th { background: var(--azul); color: #fff; font-weight: 600; font-size: .8rem; text-transform: uppercase; }
.lista tr:hover td { background: #fafbff; }
.lista td.ust { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lista .desligado td:not(:nth-last-child(-n+2)) { color: #9aa3bd; }

.alternar { display: inline-flex; border: 1px solid var(--azul); border-radius: 999px; overflow: hidden; }
.alternar button { border: 0; background: #fff; padding: 4px 12px; font-weight: 700; cursor: pointer; color: var(--azul); font-size: .82rem; }
.alternar button[aria-pressed="true"].sim { background: var(--verde); color: #fff; }
.alternar button[aria-pressed="true"].nao { background: var(--vermelho); color: #fff; }

.cartao-form { background: #fff; border-radius: var(--raio); padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0, 32, 96, .08); }
.cartao-form .largo { grid-column: 1 / -1; }
.cartao-form .acoes { display: flex; gap: 8px; }
.bloco-frente { background: #fff; border-radius: var(--raio); margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0, 32, 96, .08); overflow: hidden; }
.bloco-frente h3 { background: var(--azul); color: #fff; font-size: .95rem; font-weight: 600; padding: 9px 14px; margin: 0; }
.linha-cad { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--linha-clara); }
.linha-cad:last-child { border-bottom: 0; }
.linha-cad .nome { flex: 1; min-width: 0; }
.linha-cad .nome small { display: block; color: var(--texto-suave); }
.linha-cad .contagem { color: var(--texto-suave); font-size: .82rem; white-space: nowrap; }

dialog#d-servico { border: 0; border-radius: 12px; padding: 0; width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); color: var(--texto); }
dialog::backdrop { background: rgba(0, 20, 60, .45); }
#f-servico { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
#f-servico header, #f-servico footer { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--fundo-suave); }
#f-servico header { justify-content: space-between; }
#f-servico header h2 { font-size: 1.1rem; }
#f-servico footer span { flex: 1; }
#f-servico .grade { overflow-y: auto; padding: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#f-servico .largo { grid-column: 1 / -1; }
#f-servico .dois { grid-column: span 2; }
fieldset { border: 1px solid #aab4cf; border-radius: 6px; padding: 8px 10px; margin: 0; }
fieldset legend { font-weight: 600; color: var(--azul); font-size: .85rem; padding: 0 4px; }
fieldset legend small { font-weight: 400; color: var(--texto-suave); }
fieldset.elo { display: flex; flex-direction: row; flex-wrap: wrap; gap: 14px; align-items: center; }
fieldset.elo label { display: flex; gap: 6px; align-items: center; font-weight: 600; cursor: pointer; }
.niveis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.niveis .campo input { min-height: 36px; }
@media (max-width: 760px) {
  #f-servico .grade { grid-template-columns: 1fr 1fr; }
  #f-servico .dois { grid-column: 1 / -1; }
  .niveis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) { #f-servico .grade { grid-template-columns: 1fr; } }
