/* Painel da staff — complementa o css/style.css do site (mesmas variáveis e componentes) */

.staff-card { width: min(460px, 100% - 32px); gap: 18px; }
.staff-card h1 { font-size: clamp(2.2rem, 7vw, 3.2rem); }
.staff-logo { width: 120px; height: auto; filter: drop-shadow(0 14px 40px rgba(247, 17, 17, .35)); }
.staff-text { max-width: 38ch; font-size: .95rem; color: var(--prata); }
.staff-full { width: 100%; justify-content: center; }

.staff-back { font-size: .82rem; color: var(--cinza); transition: color .25s; }
.staff-back:hover { color: var(--prata); }

.staff-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Painel logado */
.staff-avatar {
    width: 112px; height: 112px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--vermelho);
    box-shadow: 0 0 0 6px rgba(247, 17, 17, .12), 0 20px 50px rgba(247, 17, 17, .3);
}
.staff-user { display: grid; gap: 6px; justify-items: center; }
.staff-user h1 { overflow-wrap: anywhere; }
.staff-user small { font-size: .9rem; color: var(--cinza); }

.staff-role {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-radius: 14px;
    background: rgba(255,255,255,.03); border: 1px solid var(--borda);
    font-size: .8rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--cinza);
}
.staff-role .chip { font-size: .78rem; padding: 5px 14px; box-shadow: 0 6px 20px rgba(122, 4, 4, .45); }

/* Atalhos no cartão do painel */
.staff-shortcuts { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.staff-shortcuts .btn { justify-content: center; padding: 12px 16px; font-size: .88rem; }

@media (max-width: 520px) {
    .staff-actions .btn { width: 100%; justify-content: center; }
}

/* =====================================================================
   Telas de ferramenta (Jogadores, Logs, Cargos)
   ===================================================================== */
.staff-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100svh; position: relative; isolation: isolate; }
.staff-shell::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(700px circle at 15% 0%, rgba(247, 17, 17, .12), transparent 60%),
        radial-gradient(700px circle at 100% 100%, rgba(122, 4, 4, .2), transparent 60%),
        linear-gradient(rgba(7, 5, 5, .92), rgba(7, 5, 5, .97)),
        url("img/fundo.webp") center / cover no-repeat;
}

/* Menu lateral */
.staff-side {
    position: sticky; top: 0; height: 100svh;
    display: flex; flex-direction: column; gap: 18px;
    padding: 20px 14px;
    border-right: 1px solid var(--borda);
    background: rgba(14, 9, 9, .82);
    backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.staff-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; border-bottom: 1px solid var(--borda); }
.staff-brand img { height: 46px; width: auto; filter: drop-shadow(0 6px 18px rgba(247, 17, 17, .35)); }
.staff-brand span { display: grid; line-height: 1.05; }
.staff-brand b { font-family: var(--display); font-weight: 900; font-size: 1.25rem; text-transform: uppercase; color: var(--titulo); }
.staff-brand small { margin-top: 3px; font-size: .66rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--vermelho); }

.staff-menu { flex: 1; display: grid; align-content: start; gap: 4px; overflow-y: auto; }
.staff-menu-title { padding: 16px 12px 6px; font-size: .66rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--cinza); }
.staff-menu a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 12px; border: 1px solid transparent;
    font-size: .92rem; font-weight: 600; color: var(--prata);
    transition: background .25s, color .25s, border-color .25s, box-shadow .25s;
}
.staff-menu a svg { width: 19px; height: 19px; flex: none; transition: color .25s; }
.staff-menu a:hover { color: #fff; background: rgba(255,255,255,.05); }
.staff-menu a.active {
    color: #fff; border-color: rgba(247, 17, 17, .45);
    background: linear-gradient(135deg, rgba(247, 17, 17, .2), rgba(122, 4, 4, .16));
    box-shadow: 0 10px 30px rgba(247, 17, 17, .16);
}
.staff-menu a.active svg { color: var(--vermelho); }

.staff-side-user {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    border-radius: 14px; border: 1px solid var(--borda); background: rgba(255,255,255,.03);
}
.staff-side-user img { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--vermelho); }
.staff-side-user span { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.staff-side-user b { font-size: .88rem; color: var(--titulo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-side-user small { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cinza); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.staff-icon-btn {
    width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px;
    color: var(--prata); border: 1px solid var(--borda); background: rgba(255,255,255,.04);
    transition: color .25s, border-color .25s, background .25s;
}
.staff-icon-btn svg { width: 18px; height: 18px; }
.staff-icon-btn:hover { color: #fff; border-color: rgba(247, 17, 17, .6); background: rgba(247, 17, 17, .08); }

/* Área principal */
.staff-main { min-width: 0; display: flex; flex-direction: column; }
.staff-top {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 16px;
    padding: 16px clamp(16px, 3vw, 32px);
    border-bottom: 1px solid var(--borda);
    background: rgba(7, 5, 5, .74);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.staff-top { padding-block: 10px; min-height: 64px; }
.staff-top-title { flex: 1; min-width: 0; font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-top-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }

/* Indicador do servidor + última atualização */
.staff-status {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
    font-size: .78rem; font-weight: 700; color: var(--prata); white-space: nowrap;
    border: 1px solid var(--borda); background: rgba(255,255,255,.03);
}
.staff-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--cinza); flex: none; }
.staff-status[data-state="up"] { color: var(--titulo); border-color: rgba(247, 17, 17, .35); }
.staff-status[data-state="up"] i { background: var(--vermelho); box-shadow: 0 0 0 0 rgba(247,17,17,.7); animation: pulse 1.8s infinite; }
.staff-status[data-state="down"] { color: #ffb4b4; }
.staff-status[data-state="down"] i { background: var(--cinza); }
.staff-updated { font-size: .76rem; color: var(--cinza); white-space: nowrap; }
.staff-icon-btn.is-spinning svg { animation: staff-spin .8s cubic-bezier(.2,.8,.2,1); }
@keyframes staff-spin { to { transform: rotate(360deg); } }

/* Menu recolhível (desktop): só ícones */
.staff-collapse {
    display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px;
    font-size: .8rem; font-weight: 600; color: var(--cinza); border: 1px solid transparent;
    transition: color .25s, background .25s;
}
.staff-collapse svg { width: 18px; height: 18px; flex: none; transition: transform .3s; }
.staff-collapse:hover { color: #fff; background: rgba(255,255,255,.04); }
.staff-shell { transition: grid-template-columns .3s cubic-bezier(.2,.8,.2,1); }
.staff-shell.is-collapsed { grid-template-columns: 84px minmax(0, 1fr); }
.staff-shell.is-collapsed .staff-side { padding-inline: 12px; }
.staff-shell.is-collapsed .staff-brand { justify-content: center; padding-inline: 0; }
.staff-shell.is-collapsed .staff-brand span,
.staff-shell.is-collapsed .staff-menu a span,
.staff-shell.is-collapsed .staff-menu-title,
.staff-shell.is-collapsed .staff-side-user span,
.staff-shell.is-collapsed .staff-collapse span { display: none; }
.staff-shell.is-collapsed .staff-menu a { justify-content: center; padding-inline: 0; }
.staff-shell.is-collapsed .staff-menu-title + a { margin-top: 10px; }
.staff-shell.is-collapsed .staff-side-user { flex-direction: column; padding: 8px; }
.staff-shell.is-collapsed .staff-collapse { justify-content: center; padding-inline: 0; }
.staff-shell.is-collapsed .staff-collapse svg { transform: rotate(180deg); }
.staff-burger { display: none; }
.staff-content { padding: clamp(16px, 3vw, 32px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; }
.staff-content > *, .staff-grid > * { min-width: 0; }
.staff-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }

/* Barra de filtros/busca */
.staff-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding: 14px;
    border-radius: var(--raio); border: 1px solid var(--borda); background: var(--card);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.staff-grow { flex: 1 1 260px; }
.staff-note { font-size: .9rem; color: var(--prata); }
.staff-note b { color: #fff; }

.staff-field {
    display: inline-flex; align-items: center; gap: 8px; min-width: 0;
    padding: 6px 6px 6px 14px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.3);
    transition: border-color .25s, background .25s;
}
.staff-field:focus-within { border-color: rgba(247, 17, 17, .6); background: rgba(247, 17, 17, .05); }
.staff-field svg { width: 18px; height: 18px; flex: none; color: var(--cinza); }
.staff-field > span { font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--cinza); }
.staff-field input, .staff-field select {
    flex: 1; min-width: 0; padding: 6px 4px; border: 0; outline: none;
    background: transparent; color: var(--titulo); font: inherit; font-size: .9rem;
}
.staff-field select option, .staff-form select option { background: var(--bg-2); color: var(--titulo); }

/* Layout lista + detalhe */
.staff-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.staff-panel {
    padding: 20px; border-radius: var(--raio);
    border: 1px solid var(--borda); background: rgba(14, 9, 9, .62);
    backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
    box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(247,17,17,.06) inset;
}
.staff-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.staff-panel-head h3 { font-size: 1.5rem; }
.staff-detail { position: sticky; top: 104px; display: grid; gap: 18px; }

/* Tabelas */
.staff-table-wrap { overflow-x: auto; margin-inline: -6px; }
.staff-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.staff-table th {
    text-align: left; padding: 10px 12px; white-space: nowrap;
    font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--cinza);
    border-bottom: 1px solid var(--borda);
}
.staff-table td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--prata); vertical-align: top; white-space: nowrap; }
.staff-table td.staff-details { white-space: normal; min-width: 200px; }
.staff-table td b { color: var(--titulo); }
.staff-table tbody tr[data-passport] { cursor: pointer; transition: background .2s; }
.staff-table tbody tr[data-passport]:hover, .staff-table tbody tr[data-passport]:focus-visible { background: rgba(247, 17, 17, .06); outline: none; }
.staff-table tbody tr.is-active { background: rgba(247, 17, 17, .1); box-shadow: inset 3px 0 0 var(--vermelho); }
.staff-table code { font-size: .82rem; color: var(--prata); }
.staff-empty { text-align: center; padding: 28px 12px; color: var(--cinza); font-size: .92rem; }
.staff-sub { display: block; font-size: .78rem; color: var(--cinza); }
.staff-details { max-width: 340px; font-size: .85rem; overflow-wrap: anywhere; }
.staff-nowrap { white-space: nowrap; }
.staff-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: .88rem; color: var(--cinza); }

/* Detalhe do jogador */
.staff-dhead { display: flex; align-items: center; gap: 14px; }
.staff-dhead h3 { font-size: 1.7rem; overflow-wrap: anywhere; margin-bottom: 6px; }
.staff-initial {
    width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center;
    font-family: var(--display); font-weight: 900; font-size: 1.7rem; color: #fff;
    background: linear-gradient(135deg, var(--vermelho), var(--vinho));
    box-shadow: 0 10px 28px rgba(247, 17, 17, .3);
}
.staff-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.staff-status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--cinza); }
.staff-status.is-online { color: var(--titulo); }
.dot-off { width: 8px; height: 8px; border-radius: 50%; background: var(--cinza); }
.staff-badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--titulo);
    border: 1px solid var(--borda); background: rgba(255,255,255,.05);
}
.staff-badge.is-ok { border-color: rgba(255,255,255,.18); }
.staff-label { display: block; margin-bottom: 8px; font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--cinza); }
.staff-kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--borda); font-size: .9rem; }
.staff-kv dt { color: var(--cinza); }
.staff-kv dd { color: var(--titulo); font-weight: 600; text-align: right; }
.staff-actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.staff-actions-grid .btn { justify-content: center; padding: 10px 12px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-danger { color: #ffb4b4; border-color: rgba(247, 17, 17, .4); }
.staff-danger-text { color: #ff8a8a; font-style: normal; }
.staff-hint { font-size: .8rem; color: var(--cinza); }

/* Modal (mesmo cartão da página Jogar) */
.staff-modal {
    position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px;
    background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: staff-fade .2s ease;
}
.staff-modal.is-leaving { opacity: 0; transition: opacity .2s; }
.staff-modal-card {
    width: min(520px, 100%); max-height: calc(100svh - 32px); overflow: auto;
    padding: clamp(22px, 4vw, 34px); border-radius: 28px;
    border: 1px solid var(--borda); background: rgba(14, 9, 9, .94);
    box-shadow: 0 40px 120px rgba(0,0,0,.6), 0 0 0 1px rgba(247,17,17,.08) inset;
    display: grid; gap: 16px; justify-items: start;
    animation: staff-pop .25s cubic-bezier(.2,.8,.2,1);
}
.staff-modal-card.is-wide { width: min(780px, 100%); }
.staff-modal-card h3 { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 900; }
.staff-modal-card .staff-text { max-width: none; }
.staff-modal-card .staff-actions { width: 100%; justify-content: flex-end; }
.staff-error { color: #ff8a8a; font-size: .86rem; min-height: 0; }
.staff-error:empty { display: none; }
@keyframes staff-fade { from { opacity: 0; } }
@keyframes staff-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Formulários */
.staff-form { width: 100%; display: grid; gap: 14px; }
.staff-form label:not(.staff-check) { display: grid; gap: 6px; }
.staff-form label:not(.staff-check) > span { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--cinza); }
.staff-form input:not([type=checkbox]), .staff-form select, .staff-form textarea {
    width: 100%; padding: 12px 14px; border-radius: 14px;
    border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.35);
    color: var(--titulo); font: inherit; font-size: .95rem; outline: none;
    transition: border-color .25s, background .25s;
}
.staff-form textarea { resize: vertical; min-height: 96px; }
.staff-form input:focus, .staff-form select:focus, .staff-form textarea:focus { border-color: rgba(247, 17, 17, .6); background: rgba(247, 17, 17, .05); }
.staff-form input:disabled { opacity: .45; }
.staff-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.staff-check { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--prata); cursor: pointer; }
.staff-check input { width: 18px; height: 18px; accent-color: var(--vermelho); flex: none; }
.staff-check.is-locked { opacity: .45; cursor: not-allowed; }
.staff-perms { display: grid; gap: 12px; }
.staff-perm-group { border: 1px solid var(--borda); border-radius: 14px; padding: 10px 14px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.staff-perm-group legend { padding: 0 6px; font-family: var(--display); font-size: 1.05rem; font-weight: 800; text-transform: uppercase; color: var(--titulo); }

/* Avisos */
.staff-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 160; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.staff-toast {
    padding: 14px 18px; border-radius: 14px; font-size: .9rem; color: var(--titulo);
    background: rgba(14, 9, 9, .96); border: 1px solid var(--borda); border-left: 3px solid var(--vermelho);
    box-shadow: 0 20px 50px rgba(0,0,0,.5); animation: staff-pop .25s ease;
}
.staff-toast.is-error { border-left-color: var(--cinza); color: #ffb4b4; }
.staff-toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s; }

@media (max-width: 1024px) {
    .staff-grid { grid-template-columns: minmax(0, 1fr); }
    .staff-detail { position: static; }
}

/* Celular/tablet: menu lateral vira gaveta */
@media (max-width: 960px) {
    .staff-shell, .staff-shell.is-collapsed { grid-template-columns: minmax(0, 1fr); }
    .staff-collapse { display: none; }
    .staff-shell.is-collapsed .staff-brand span, .staff-shell.is-collapsed .staff-menu a span,
    .staff-shell.is-collapsed .staff-menu-title, .staff-shell.is-collapsed .staff-side-user span { display: revert; }
    .staff-shell.is-collapsed .staff-menu a { justify-content: flex-start; padding-inline: 14px; }
    .staff-shell.is-collapsed .staff-side-user { flex-direction: row; }
    .staff-updated { display: none; }
    .staff-side {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: min(290px, 86vw);
        transform: translateX(-100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
    }
    .staff-shell.side-open .staff-side { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
    .staff-burger { display: grid; }
    .staff-hide-sm { display: none; }
    .staff-top-title p { display: none; }
}
@media (max-width: 600px) {
    .staff-top { flex-wrap: wrap; }
    .staff-top-actions { order: 3; width: 100%; }
    .staff-top-actions .btn { flex: 1; justify-content: center; }
    .staff-content { padding: 16px; }
    .staff-panel { padding: 16px; }
    .staff-kv dd { overflow-wrap: anywhere; }
}
@media (max-width: 520px) {
    .staff-form-row { grid-template-columns: 1fr; }
    .staff-actions-grid .btn { padding: 10px 8px; font-size: .8rem; }
    .staff-toolbar > * { flex: 1 1 100%; }
    .staff-modal-card .staff-actions .btn { width: 100%; justify-content: center; }
}
