:root {
  color-scheme: dark;
  --page:#081323; --panel:#101f34; --surface:#132740; --edge:#3b4e66;
  --text:#f4f7fb; --muted:#bbc9d9; --gold:#ffc722; --navy:#071426;
  --green:#77e1b5; --red:#ffb4bc;
  font:16px/1.48 Arial, sans-serif;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; color:var(--text); background:var(--page); }
a { color:var(--gold); }
button, input, select { font:inherit; }
button, .button {
  display:inline-flex; align-items:center; justify-content:center;
  min-height:42px; padding:9px 14px; border:1px solid transparent; border-radius:8px;
  font-weight:700; line-height:1.2; text-align:center; text-decoration:none;
  background:var(--gold); color:#101724; cursor:pointer;
}
.secondary { background:#283d55; border-color:#415772; color:var(--text); }
.whatsapp { background:#095e48; color:#f0fffa; border-color:#267e67; }
.danger { background:#4d2635; color:#ffced4; border-color:#704050; }
button:disabled, .button[aria-disabled=true] { opacity:.62; cursor:default; }
:where(button, a, input, select, summary):focus-visible { outline:2px solid #ffd862; outline-offset:3px; }
.site-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px clamp(16px,5vw,58px); background:#060f20; border-bottom:2px solid #9a7823; }
.brand { display:flex; align-items:center; gap:12px; color:var(--text); text-decoration:none; white-space:nowrap; }
.brand span { color:var(--gold); }
.top-actions,.form-actions,.card-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
main { max-width:1100px; padding:0 24px 48px; margin:auto; }
.page-title { margin:29px 0 20px; }
h1,h2,h3,p { margin:0; }
h1 { color:var(--gold); line-height:1.15; font-size:clamp(29px,4vw,43px); }
h2 { color:var(--gold); line-height:1.18; font-size:1.36rem; }
h3 { font-size:1.05rem; }
p { color:var(--muted); }
.page-title p, h2 + p { margin-top:7px; }
.panel { margin-bottom:16px; padding:clamp(14px,2.4vw,24px); background:var(--panel); border:1px solid #31445c; border-radius:13px; }
.section-head, .team-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:13px; }
.team-head { align-items:end; }
.team-head p { margin:7px 0 0; }
.tabs { display:flex; gap:8px; margin-bottom:13px; }
.tabs button:not([aria-pressed=true]) { color:var(--text); background:#22354d; border-color:#40536a; }
.message { margin:0 0 14px; padding:11px 14px; border:1px solid #3b8c76; border-left-width:4px; background:#12372f; border-radius:8px; color:#e7fff7; }
.message.error { border-color:#b85968; background:#4b2834; color:#ffe7eb; }
.list-empty { border:1px dashed var(--edge); border-radius:8px; padding:14px; }
.grant-card, .notice, .tool-panel { border:1px solid #3a4e65; border-radius:10px; padding:13px; background:#0b182a; }
.grant-card + .grant-card, .notice + .notice, .tool-panel + .tool-panel { margin-top:10px; }
.grant-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.grant-meta { font-size:.88rem; margin-top:4px; }
.grant-permissions { font-size:.91rem; margin:9px 0; color:var(--text); }
.grant-notification { margin:8px 0; font-size:.85rem; }
.badge { display:inline-block; padding:4px 8px; border-radius:20px; background:#293f58; color:#e1ebf7; font-size:.8rem; font-weight:700; white-space:nowrap; }
.badge.activo { background:#114a3b; color:#adf8d7; }
.badge.pendiente { background:#4d3819; color:#ffe1a3; }
.badge.revocado { background:#492b37; color:#ffced6; }
.fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; }
.history-fields { grid-template-columns:minmax(0,2fr) minmax(0,1.3fr) repeat(2,minmax(0,1fr)); margin-bottom:13px; }
.fields label, .team-head label, #password-dialog label { display:grid; gap:4px; font-size:.9rem; font-weight:700; }
input:not([type=checkbox]), select {
  width:100%; min-width:0; padding:8px 10px; min-height:41px; border:1px solid #52657d; border-radius:7px; color:var(--text); background:#091728;
}
input[type=checkbox] { width:20px; height:20px; margin:0; accent-color:var(--gold); }
input::placeholder { color:#98aabf; }
.table-wrap { overflow:auto; }
table { border-collapse:collapse; width:100%; font-size:.91rem; }
th,td { text-align:left; vertical-align:top; padding:9px 10px; border-bottom:1px solid #35485e; }
th { color:#ffe1a2; background:#142843; }
td { overflow-wrap:anywhere; }
td form { display:flex; gap:6px; align-items:center; }
td form input[name=number] { width:80px; }
.account-panel { max-width:600px; }
.account-fields { grid-template-columns:minmax(0,1fr); margin-top:15px; }
.account-fields button { justify-self:start; }
.player-login, .tool-panel p, .tool-panel .table-wrap, .tool-panel .fields, .tool-panel .form-actions { margin-top:11px; }
.notice p { margin-top:5px; }
.notice .button, .notice button { margin-top:8px; }
.demo-caption { background:#313b53; color:#fff; margin-top:12px; padding:7px 11px; border-radius:6px; }
summary { cursor:pointer; font-weight:700; color:var(--gold); }
dialog { max-height:calc(100% - 32px); width:min(725px,calc(100% - 28px)); border:1px solid #5b7088; border-radius:14px; background:#112239; color:var(--text); padding:18px; }
dialog::backdrop { background:#020918cc; }
dialog fieldset { margin:10px 0 14px; min-width:0; padding:11px; border:1px solid var(--edge); border-radius:8px; }
dialog legend { font-weight:700; color:#ffe1a2; padding:0 5px; }
dialog fieldset p { margin-top:7px; font-size:.85rem; }
.permissions-grid { display:grid; gap:7px; }
.permission-row { display:flex; flex-wrap:wrap; align-items:center; gap:9px 13px; min-height:30px; }
.permission-row b { flex:0 0 123px; }
.permission-row label { display:inline-flex; align-items:center; gap:6px; }
#temporary-password { font-family:monospace; }
#password-dialog .form-actions { margin-top:12px; }
.compact { font-size:.85rem; }
@media(max-width:680px) {
  .site-header { align-items:flex-start; flex-wrap:wrap; }
  main { padding-inline:11px; }
  .section-head,.team-head { align-items:flex-start; flex-wrap:wrap; }
  .history-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .history-fields label:first-child { grid-column:1/-1; }
  th,td { padding:8px 6px; }
  .permission-row b { flex-basis:100%; }
}
@media(max-width:400px) {
  .fields:not(.history-fields) { grid-template-columns:1fr; }
}
