:root {
  font-family:
    Inter,
    Segoe UI,
    sans-serif;
  color: #17201e;
  background: #f4f6f2;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
}
aside {
  width: 240px;
  background: #132b26;
  color: #dce9e2;
  padding: 32px 22px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -1px;
}
.brand small {
  font-size: 9px;
  display: block;
  letter-spacing: 2px;
  margin-top: 5px;
  color: #9bb7aa;
}
.logo {
  width: 39px;
  height: 43px;
  display: grid;
  place-content: center;
  border: 1px solid #8ac29e;
  border-radius: 12px;
  color: #b6e5ad;
}
nav {
  margin-top: 46px;
  display: grid;
  gap: 6px;
}
nav button {
  background: none;
  border: 0;
  text-align: left;
  color: #aec4b9;
  padding: 12px 14px;
}
nav button.active {
  background: #29483d;
  color: #e6f6d8;
}
.aside-bottom {
  margin-top: auto;
  font-size: 11px;
  color: #a6c0ae;
  display: grid;
  gap: 12px;
}
.dot {
  width: 6px;
  height: 6px;
  background: #b2d794;
  border-radius: 100%;
  display: inline-block;
}
.subtle {
  background: transparent;
  color: inherit;
  border-color: #41584d;
}
body.login-page > aside,
body.login-page > main > header {
  display: none;
}
body.login-page > main {
  margin-left: 0;
  width: 100%;
}
body.login-page #login {
  margin-inline: auto;
}
main {
  margin-left: 240px;
  width: calc(100% - 240px);
  padding: 45px 5vw 20px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #6d8172;
}
h1 {
  font-size: 34px;
  letter-spacing: -1.3px;
  margin: 10px 0;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.6px;
}
h3 {
  font-size: 16px;
}
p {
  font-size: 14px;
  color: #68776c;
  line-height: 1.7;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #cfd9ce;
  background: #fff;
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}
button:hover {
  filter: brightness(0.95);
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
.primary {
  background: #294b36;
  color: #fff;
  border-color: #294b36;
}
.danger {
  color: #a33333;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #ccd7cb;
  background: #fff;
  padding: 11px 12px;
  border-radius: 6px;
  color: #24392c;
  margin-top: 8px;
}
textarea {
  min-height: 160px;
  resize: vertical;
  font-family: Consolas, monospace;
  font-size: 12px;
}
input[type='checkbox'] {
  display: inline;
  width: auto;
  margin: 0 8px 0 0;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 18px 0;
  color: #536651;
}
.card {
  background: white;
  border: 1px solid #e0e6dc;
  border-radius: 12px;
  padding: 26px;
}
.narrow {
  max-width: 530px;
  margin: 70px auto;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.stat strong {
  display: block;
  font-size: 38px;
  font-weight: 500;
  margin-top: 16px;
  letter-spacing: -1px;
}
.stat span {
  font-size: 12px;
  color: #6c7d6b;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.toolbar select {
  width: auto;
  margin: 0;
}
.toolbar .primary {
  margin-left: auto;
}
.badge {
  display: inline-block;
  border-radius: 5px;
  background: #edf2e9;
  color: #3e673b;
  font-size: 11px;
  padding: 5px 8px;
}
.badge.warn {
  color: #975d26;
  background: #faf1de;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  color: #788473;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 14px 12px;
  border-bottom: 1px solid #e4e9df;
}
td {
  padding: 17px 12px;
  border-bottom: 1px solid #edf0e9;
  max-width: 340px;
  overflow-wrap: anywhere;
}
td button {
  margin: 2px;
  padding: 6px 9px;
}
.empty {
  padding: 55px;
  text-align: center;
  color: #7a8976;
}
.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 25px;
}
dialog {
  border: 1px solid #d7e0d2;
  border-radius: 14px;
  max-width: 760px;
  width: 90vw;
  padding: 30px;
  max-height: 90vh;
}
dialog::backdrop {
  background: #14291c88;
}
#notice:not(:empty) {
  padding: 13px 18px;
  border-radius: 7px;
  background: #e5eddf;
  margin-bottom: 20px;
  font-size: 13px;
}
#notice.error,
#edit-error {
  color: #a33333;
}
#edit-error {
  font-size: 12px;
  white-space: pre-wrap;
}
footer {
  margin-top: 65px;
  border-top: 1px solid #dce4d6;
  padding-top: 20px;
  font-size: 10px;
  color: #8a9582;
  display: flex;
  gap: 24px;
}
footer a {
  margin-left: auto;
  color: #4b694a;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
img.qr {
  max-width: 260px;
  display: block;
  margin: auto;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.pager {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}
/* El menú móvil se despliega sólo cuando se necesita; el contenido conserva todo el ancho. */
#menu-toggle {
  display: none;
}
#navigation {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
aside {
  overflow-y: auto;
}
.aside-bottom {
  padding-top: 24px;
}
main,
#content,
.card,
.toolbar > *,
header > * {
  min-width: 0;
}
header,
.section-title,
.toolbar,
.actions,
.pager,
footer {
  gap: 12px;
  flex-wrap: wrap;
}
.stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat strong {
  font-size: clamp(24px, 3vw, 38px);
  overflow-wrap: anywhere;
}
button {
  min-height: 44px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #69965b;
  outline-offset: 3px;
}
.toolbar select {
  max-width: 100%;
}
.table-wrap {
  max-width: 100%;
}
table {
  min-width: 560px;
}
p,
h1,
h2,
label,
#notice,
#identity {
  overflow-wrap: anywhere;
}
img.qr {
  width: 100%;
  max-width: 260px;
  height: auto;
}
dialog {
  max-height: 90dvh;
  overflow-y: auto;
}
@media (max-width: 1000px) {
  body {
    display: block;
  }
  aside {
    position: static;
    width: 100%;
    padding: 16px 24px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
  }
  .brand {
    font-size: 20px;
  }
  #menu-toggle {
    display: block;
    margin-left: auto;
  }
  #navigation {
    display: none;
    flex-basis: 100%;
    max-height: 65dvh;
  }
  #navigation.open {
    display: flex;
  }
  nav {
    margin-top: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  nav button {
    padding: 12px;
    font-size: 14px;
  }
  .aside-bottom {
    grid-template-columns: auto 1fr;
    align-items: center;
    padding-top: 16px;
  }
  .aside-bottom #identity,
  .aside-bottom button {
    grid-column: 2;
  }
  main {
    margin: 0;
    width: 100%;
    padding: 24px;
  }
  h1 {
    font-size: 28px;
  }
}
@media (max-width: 600px) {
  aside {
    padding: 14px 16px;
  }
  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  main {
    padding: 20px 16px;
  }
  header {
    align-items: flex-start;
    margin-bottom: 20px;
  }
  h1 {
    font-size: 26px;
  }
  .eyebrow {
    letter-spacing: 1.3px;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card {
    padding: 18px;
  }
  .stat strong {
    margin-top: 8px;
    font-size: 30px;
  }
  .narrow {
    margin: 24px auto;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar select,
  .toolbar .primary {
    width: 100%;
    margin-left: 0;
  }
  .empty {
    padding: 28px 8px;
  }
  .table-wrap {
    padding: 8px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  input[type='checkbox'] {
    width: 20px;
    height: 20px;
    vertical-align: middle;
  }
  dialog {
    width: calc(100% - 24px);
    max-width: none;
    padding: 20px 16px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .actions button {
    flex: 1;
  }
  footer {
    margin-top: 36px;
    line-height: 1.6;
  }
  footer span {
    flex-basis: 100%;
  }
  footer a {
    margin-left: 0;
  }
}
/* En celular cada fila conserva sus etiquetas y acciones sin desplazamiento horizontal. */
@media (max-width: 600px) {
  .table-wrap table {
    min-width: 0;
  }
  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .table-wrap tbody,
  .table-wrap tr {
    display: block;
  }
  .table-wrap tr {
    padding: 12px 8px;
    border-bottom: 1px solid #dce4d6;
  }
  .table-wrap tr:last-child {
    border-bottom: 0;
  }
  .table-wrap td {
    display: grid;
    grid-template-columns: 85px minmax(0, 1fr);
    gap: 12px;
    max-width: none;
    padding: 8px 0;
    border: 0;
  }
  .table-wrap td::before {
    content: attr(data-label);
    color: #788473;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }
  .table-wrap td.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }
  .table-wrap td.row-actions::before {
    flex-basis: 100%;
  }
  .table-wrap td.row-actions:empty {
    display: none;
  }
  .row-actions button {
    flex: 1;
    margin: 0;
  }
}
.rules-hint {
  font-size: 11px;
  line-height: 1.5;
  color: #68776c;
  margin: -8px 0 16px;
  overflow-wrap: anywhere;
}
.event-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.event-overview .card {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.event-overview h3 {
  margin: 0 0 4px;
  font-size: 11px;
  line-height: 1.3;
  color: #68776c;
}
.event-overview strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}
.event-overview p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.35;
}
.event-next {
  border-color: #91ad85;
  background: #f0f6ec;
}
.event-filters {
  margin-bottom: 12px;
  justify-content: flex-end;
}
.toolbar.event-filters button {
  margin-left: 0;
  width: auto;
}
