/* MStee — área do administrador */

body.admin { background: var(--bg-soft); min-height: 100vh; }
[hidden] { display: none !important; }

/* ---------- campos ---------- */
.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .inp {
  font: inherit; font-size: 1rem; font-weight: 400; color: var(--ink);
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus,
textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(212, 13, 18, .12); }
textarea { font: inherit; resize: vertical; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin: 14px 0 18px; color: var(--ink-2); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 16px; font-size: .95rem; }
.btn--dashed { border-style: dashed; color: var(--muted); width: 100%; margin-top: 16px; border-radius: var(--radius); padding: 16px; }
.btn--dashed:hover { color: var(--red); border-color: var(--red); transform: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.link { background: none; border: 0; color: var(--red); font: inherit; font-weight: 600; cursor: pointer; padding: 4px; }
.icon-btn {
  width: 34px; height: 34px; flex: none; border-radius: 8px; border: 1.5px solid var(--line); background: #fff;
  cursor: pointer; color: var(--muted); display: grid; place-items: center; font-size: 1rem; line-height: 1;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.icon-btn.danger:hover { color: #fff; background: var(--red); border-color: var(--red); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.erro { color: var(--red); font-size: .92rem; min-height: 1.4em; margin: 10px 0 0; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.login-card { width: 100%; max-width: 440px; background: #fff; border-radius: 18px; padding: 36px 32px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.login-card img { margin: 0 auto 18px; }
.login-card h1 { font-size: 2rem; text-transform: uppercase; text-align: center; }
.login-card > p { text-align: center; }
.ajuda { margin-top: 20px; font-size: .92rem; border-top: 1px solid var(--line); padding-top: 14px; }
.ajuda summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.ajuda ol { padding-left: 20px; }
.ajuda li { margin-bottom: 6px; }
.voltar { display: block; text-align: center; margin-top: 18px; font-size: .92rem; text-decoration: none; }

/* ---------- barra superior ---------- */
.admin-bar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 40; }
.admin-bar .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.admin-bar .brand img { height: 36px; width: auto; background: #fff; border-radius: 8px; padding: 3px 6px; }
.admin-tabs { display: flex; gap: 4px; flex: 1; }
.admin-tabs button {
  background: none; border: 0; color: #b9bec7; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; letter-spacing: .05em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 8px;
}
.admin-tabs button:hover { color: #fff; }
.admin-tabs button[aria-selected="true"] { color: var(--ink); background: var(--ball); }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: #b9bec7; }
.admin-user .link { color: var(--ball); }
@media (max-width: 640px) {
  .admin-bar .brand, #usuario { display: none; }
  .admin-bar .wrap { gap: 8px; }
  .admin-tabs button { font-size: 1rem; padding: 8px 10px; }
}

/* ---------- conteúdo ---------- */
.admin-main { padding-top: 32px; padding-bottom: 120px; }
.aba-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.aba-head h1 { font-size: 2.4rem; text-transform: uppercase; margin-bottom: .1em; }
.aba-head p { margin: 0; }
.periodo { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.periodo select { min-width: 150px; }
.periodo input { width: 110px; }
.stack { display: grid; gap: 20px; }

/* ---------- ranking ---------- */
.cat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cat-head { display: flex; gap: 10px; align-items: center; padding: 14px 16px; background: var(--ink); }
.cat-head .inp { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; text-transform: uppercase; letter-spacing: .03em; background: transparent; color: #fff; border-color: transparent; flex: 1; min-width: 0; }
.cat-head .inp:focus { border-color: var(--ball); box-shadow: none; }
.cat-head .icon-btn { background: transparent; color: #b9bec7; border-color: #3a3f47; }
.cat-head .icon-btn:hover { color: #fff; border-color: #fff; }
.cat-head .icon-btn.danger:hover { background: var(--red); border-color: var(--red); }
.cat-count { color: #9aa1ab; font-size: .85rem; white-space: nowrap; }
.cat-body { padding: 8px 16px 16px; }
.rows-head, .row { display: grid; grid-template-columns: 70px 1fr 100px auto; gap: 8px; align-items: center; }
.rows-head { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 0 4px; }
.row { padding: 4px 0; }
.row .inp { padding: 8px 10px; }
.row .inp.pos { text-align: center; font-weight: 600; }
.row-actions { display: flex; gap: 4px; }
.cat-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cat-empty { color: var(--muted); padding: 16px 0 4px; font-size: .95rem; }
@media (max-width: 640px) {
  .rows-head { display: none; }
  .row { grid-template-columns: 56px 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .row .inp.pts { grid-column: 1 / 2; }
  .row-actions { grid-column: 2 / 3; justify-content: flex-end; }
}

/* ---------- aniversariantes ---------- */
.bday-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.bcard { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.bcard-photo { position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft); display: grid; place-items: center; overflow: hidden; }
.bcard-photo img { width: 100%; height: 100%; object-fit: cover; }
.bcard-photo .sem-foto { color: var(--muted); font-size: .9rem; }
.bcard-photo .foto-acoes { position: absolute; bottom: 10px; right: 10px; display: flex; gap: 6px; }
.bcard-photo .foto-acoes label, .bcard-photo .foto-acoes button {
  background: rgba(20, 22, 26, .82); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px;
  font-size: .85rem; font-weight: 600; cursor: pointer;
}
.bcard-photo .foto-acoes label:hover, .bcard-photo .foto-acoes button:hover { background: var(--red); }
.bcard-photo .foto-acoes input { display: none; }
.badge-novo { position: absolute; top: 10px; left: 10px; background: var(--ball); color: var(--ink); font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; }
.bcard-body { padding: 16px; display: grid; gap: 10px; }
.bcard-row { display: grid; grid-template-columns: 1fr 80px; gap: 10px; }
.bcard-foot { display: flex; justify-content: space-between; align-items: center; }
.bcard-foot .link { font-size: .88rem; }

/* ---------- barra de salvar ---------- */
.save-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .06); }
.save-bar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 72px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.save-actions { display: flex; gap: 10px; }
.status { font-size: .95rem; color: var(--muted); }
.status.sujo { color: var(--clay); font-weight: 600; }
.status.ok { color: #1e8a4c; font-weight: 600; }

/* ---------- dialog ---------- */
.dlg { border: 0; border-radius: 16px; padding: 28px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dlg::backdrop { background: rgba(14, 16, 20, .6); }
.dlg h2 { font-size: 1.8rem; }
.dlg code { background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: .95rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.erro { background: var(--red); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- login com usuário e senha ---------- */
.login-card form { display: grid; gap: 12px; }
.login-card form > p { margin: 0 0 4px; text-align: center; }
.login-card .check { margin: 2px 0 6px; }
.login-card .erro { margin: 0; text-align: center; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
.link--center { justify-self: center; font-size: .92rem; }
.login-card .ajuda { margin-top: 4px; }

/* ---------- aviso de senha inicial ---------- */
.aviso { background: #fff7d1; border-bottom: 1px solid #f0de8a; color: var(--ink-2); }
.aviso .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; padding-bottom: 10px; font-size: .95rem; }
.dlg form { display: grid; gap: 12px; }
.dlg form h2 { margin-bottom: 0; }
