﻿/* Combat Manager — Admin (Fantasy Professional, fixed background) */

:root {
  --bg: #05040a;
  --ink: #efe9d8;
  --muted: #b8ad94;

  --panel: #0d0b14;
  --card: #0c0a12;

  --gold: #d6b36a;
  --gold2: #f0d79a;
  --ruby: #b0263e;
  --emerald: #2fbf7b;
  --violet: #7c4dff;

  --border: rgba(214, 179, 106, .28);
  --border-strong: rgba(214, 179, 106, .55);
  --shadow: rgba(0, 0, 0, .6);
}

* {
  box-sizing: border-box
}

html,
body {
  min-height: 100%;
  height: 100%;
}

body {
  margin: 0;
  padding: 32px;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Arial;
  background-color: var(--bg);
}

/* Fondo arcano fijo, sin cortes ni degradados raros */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(800px 600px at 15% 10%, rgba(124, 77, 255, .12), transparent 60%),
    radial-gradient(700px 500px at 85% 15%, rgba(176, 38, 62, .10), transparent 60%),
    radial-gradient(900px 700px at 50% 90%, rgba(214, 179, 106, .08), transparent 60%),
    repeating-linear-gradient(135deg,
      rgba(214, 179, 106, .03) 0 1px,
      transparent 1px 14px);
}

/* Layout */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 28px 0;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(214, 179, 106, .18);
}

header h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: .6px;
  font-family: ui-serif, Georgia, "Times New Roman", Times;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .4px;
  color: var(--gold2);
  border: 1px solid rgba(214, 179, 106, .35);
  background: rgba(214, 179, 106, .08);
}

/* Card tipo pergamino encantado */
.card {
  position: relative;
  max-width: 980px;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(12, 10, 18, .92);
  box-shadow: 0 18px 44px var(--shadow);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .03),
    inset 0 0 24px rgba(214, 179, 106, .06);
}

.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

label {
  font-size: 13px;
  color: var(--muted);
}

input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(5, 4, 10, .6);
  color: var(--ink);
  border: 1px solid rgba(214, 179, 106, .22);
}

input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

input:focus {
  outline: none;
  border-color: rgba(240, 215, 154, .75);
  box-shadow: 0 0 0 3px rgba(214, 179, 106, .18);
}

/* Botones */
button,
a.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(214, 179, 106, .42);
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  color: #140a10;
  font-weight: 700;
  letter-spacing: .35px;
  text-decoration: none;
  cursor: pointer;
  transition: all .18s ease;
}

button:hover,
a.button:hover,
button.button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

button:disabled,
a.button.disabled,
button.button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.button--small,
button.button.button--small,
a.button.button--small {
  padding: 8px 12px;
  font-size: .85rem;
  border-radius: 10px;
}


button#logout {
  background: rgba(176, 38, 62, .25);
  color: var(--gold2);
  border-color: rgba(176, 38, 62, .55);
}

a {
  color: var(--gold2);
}

small {
  color: var(--muted);
}

.error {
  color: #ff5c74
}

.success {
  color: var(--emerald)
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%
}

th {
  color: var(--gold2);
  text-align: left;
  font-weight: 700;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid rgba(214, 179, 106, .12);
}

/* Modal (reusable) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.modal-backdrop[data-open="true"] {
  display: flex;
}

.modal {
  width: min(980px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: rgba(19, 18, 22, .98);
  border: 1px solid rgba(176, 136, 59, .22);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  /*
    Ensure readability even if later parts of this stylesheet redefine :root
    variables for light layouts (e.g., --ink becomes dark).
  */
  --ink: #efe9d8;
  --muted: #b8ad94;
  color: var(--ink);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(176, 136, 59, .18);
}

.modal-header h2,
.modal-header small {
  color: var(--gold2);
}

.modal-header small {
  opacity: .92
}

.modal-body {
  padding: 16px 18px;
  color: var(--ink);
}

.modal-body small {
  color: var(--muted);
}

.modal-body a {
  color: var(--gold2);
}

.modal-body label {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.modal-body label select,
.modal-body label input {
  margin-top: 6px;
  background: #f9f9f9;
  color: #1a1a1a;
  border: 2px solid rgba(214, 179, 106, .4);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.modal-body label input::placeholder {
  color: #999;
}

.modal-body label input:focus {
  outline: none;
  border-color: rgba(240, 215, 154, .8);
  box-shadow: 0 0 0 3px rgba(214, 179, 106, .15);
  background: rgba(30, 28, 36, 1);
}

/* Spell filter search input - highest priority */
#spell-filter-search {
  background: #f9f9f9 !important;
  color: #1a1a1a !important;
  border: 2px solid rgba(214, 179, 106, .4) !important;
}

#spell-filter-search::placeholder {
  color: #999 !important;
}

/* Inventory modal select styling */
#inv-modal-container,
#inv-modal-slot,
#inv-search-type {
  background: #f9f9f9 !important;
  color: #1a1a1a !important;
  border: 1px solid rgba(214, 179, 106, .3) !important;
  padding: 8px 10px !important;
  border-radius: 6px !important;
  font-size: 14px !important;
}

#inv-modal-container option,
#inv-modal-slot option,
#inv-search-type option {
  color: #1a1a1a;
  background: #f9f9f9;
}

#inv-search {
  background: #f9f9f9 !important;
  color: #1a1a1a !important;
  border: 1px solid rgba(214, 179, 106, .3) !important;
}

#inv-search::placeholder {
  color: #999 !important;
}

.modal-close {
  background: transparent;
  border: 1px solid rgba(176, 136, 59, .28);
  color: inherit;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.modal-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
}

.enemy-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(176, 136, 59, .25);
  background: rgba(255, 255, 255, .05);
}

.enemy-hero {
  width: 160px;
  height: 160px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(176, 136, 59, .25);
  background: rgba(255, 255, 255, .05);
}

/* Character detail (modal) */
.detail-hero {
  display: flex;
  gap: 14px;
  align-items: flex-start
}

.detail-avatar {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(176, 136, 59, .25);
  background: rgba(255, 255, 255, .05);
}

.detail-hero-text {
  min-width: 0
}

.detail-name {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.15
}

.detail-lines {
  margin-top: 8px
}

.detail-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  line-height: 1.3
}

.pipe-sep {
  color: var(--gold2);
  opacity: .95;
  margin: 0 2px
}

.pipe-part {
  color: var(--ink)
}

.section-title {
  margin: 0 0 8px 0;
  color: var(--gold2)
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px 10px;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat-card {
  border: 1px solid rgba(176, 136, 59, .22);
  background: rgba(255, 255, 255, .03);
  border-radius: 14px;
  padding: 14px 10px 38px;
  min-height: 124px;
  position: relative;
  overflow: visible;
  text-align: center;
}

.stat-label {
  font-weight: 900;
  color: var(--gold2);
  letter-spacing: .08em;
  font-size: 12px;
}

.stat-mod {
  margin-top: 8px;
  font-size: 38px;
  font-weight: 950;
  line-height: 1;
  color: var(--ink);
}

/* Círculo inferior (tirada) sobresaliendo a la mitad */
.stat-roll {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 50%);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  color: #000;
  background: var(--card);
  border: 2px solid rgba(176, 136, 59, .40);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

/* Detail tabs (modal) */
.detail-tabs {
  display: flex;
  gap: 8px;
  margin-top: 40px;
}

.detail-tab-btn {
  border: 1px solid rgba(176, 136, 59, .22);
  background: rgba(255, 255, 255, .03);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
}

.detail-tab-btn.is-active {
  border-color: rgba(176, 136, 59, .55);
  background: rgba(176, 136, 59, .12);
}

.detail-tab-panel {
  display: none;
}

.detail-tab-panel.is-active {
  display: block;
}

.detail-subtabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}

.detail-subtab-btn {
  border: 1px solid rgba(176, 136, 59, .18);
  background: rgba(0, 0, 0, .06);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

.detail-subtab-btn.is-active {
  border-color: rgba(176, 136, 59, .55);
  background: rgba(176, 136, 59, .10);
}

.detail-subpanel {
  display: none;
}

.detail-subpanel.is-active {
  display: block;
}

.skills-table {
  width: 100%;
  border-collapse: collapse;
}

.skills-table th,
.skills-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(176, 136, 59, .16);
}

.skills-table th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.skills-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(176, 136, 59, .25);
  background: rgba(176, 136, 59, .08);
  font-size: 12px;
  font-weight: 800;
}

/* Skills grouped cards (character detail) */
.skills-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

@media (max-width:640px) {
  .skills-groups {
    grid-template-columns: 1fr;
  }
}

.skills-group-card {
  border: 1px solid rgba(176, 136, 59, 1);
  background: rgba(19, 18, 22, .98);
  border-radius: 14px;
  padding: 10px 12px;
}

.skills-group-title {
  font-weight: 950;
  margin-bottom: 8px;
}

.skills-group-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skills-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .04);
  border: 1px solid rgba(176, 136, 59, .10);
}

.skills-row-icon {
  width: 18px;
  text-align: center;
  font-weight: 950;
}

.skills-row-name {
  flex: 1;
}

.skills-row-value {
  min-width: 34px;
  text-align: right;
}

/* Admin data tables: horizontal scroll only inside the section + sticky header */
.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  /* keeps the header in place while you scroll the table, not the whole page */
  max-height: 60vh;
  border-radius: 12px;
  border: 1px solid rgba(176, 136, 59, .18);
  background: var(--card);
}

.table-scroll table {
  width: max-content;
  min-width: 100%;
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(176, 136, 59, .22);
}

/* Responsive */
@media (max-width:640px) {
  body {
    padding: 18px
  }

  header {
    flex-direction: column;
    align-items: flex-start
  }
}


/* Auth (login) layout */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.auth-header {
  margin-bottom: 18px;
}

.auth-header h1 {
  font-size: 24px;
  margin: 0 0 8px 0;
}

.auth-card {
  margin: 0 auto;
}

.field {
  text-align: left;
  margin-bottom: 14px;
}


/* --- Admin App Shell (sidebar) --- */
.app-shell {
  display: flex;
  gap: 0;
  padding: 0;
  min-height: 100vh;
}

.app-sidebar {
  width: 280px;
  flex: 0 0 280px;
  padding: 22px 18px;
  border-right: 1px solid rgba(214, 179, 106, .18);
  background: rgba(5, 4, 10, .55);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 14px 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(214, 179, 106, .16);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(214, 179, 106, .35);
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(240, 215, 154, .25), transparent 55%),
    linear-gradient(180deg, rgba(214, 179, 106, .18), rgba(176, 38, 62, .10));
  display: grid;
  place-items: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .35);
}

.brand-title {
  font-family: ui-serif, Georgia, "Times New Roman", Times;
  font-size: 16px;
  letter-spacing: .5px;
  margin: 0;
}

.brand-sub {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
}

.nav a:hover {
  border-color: rgba(214, 179, 106, .22);
  background: rgba(214, 179, 106, .06);
  text-decoration: none;
}

.nav a.active {
  border-color: rgba(214, 179, 106, .35);
  background: rgba(214, 179, 106, .10);
}

.nav small {
  color: var(--muted);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(214, 179, 106, .16);
  border-radius: 16px;
  background: rgba(12, 10, 18, .55);
}

.user-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-pill strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-pill span {
  font-size: 12px;
  color: var(--muted);
}

.logout-btn {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(176, 38, 62, .55);
  background: rgba(176, 38, 62, .18);
  color: var(--gold2);
  font-weight: 700;
  cursor: pointer;
}

.app-main {
  flex: 1 1 auto;
  padding: 28px 28px 40px 28px;
  /* IMPORTANT: allow flex item to shrink so wide tables don't expand the whole layout */
  min-width: 0;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(214, 179, 106, .18);
}

.app-header h1 {
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", Times;
  font-size: 26px;
  letter-spacing: .6px;
}

.app-header p {
  margin: 6px 0 0 0;
  color: var(--muted);
}

.app-header .header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.session-panel {
  margin-bottom: 24px;
  padding: 22px 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(214, 179, 106, 0.18);
}

.session-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.session-description {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 620px;
}

.session-output {
  margin-top: 18px;
}

.session-output-label {
  margin: 0 0 10px;
  color: var(--muted);
}

.session-code {
  display: inline-flex;
  align-items: center;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(11, 7, 13, 0.95);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: .08em;
}

.session-copy-note {
  margin: 10px 0 0;
  color: var(--muted);
}

.content-card {
  max-width: none;
  min-width: 0;
}

/* Tables admin: the CARD provides horizontal scroll (not the whole page) */
.table-card {
  overflow-x: auto;
  overflow-y: visible;
}

/* The inner wrapper should NOT create its own scrollbars */
.table-card .table-scroll {
  overflow: visible;
  max-height: none;
  border: none;
  background: transparent;
}

/* Ensure the data table can be wider than the card to trigger horizontal scroll */
.table-card #data-table {
  width: max-content;
  min-width: 100%;
}

/* Sticky header is only useful when the wrapper scrolls vertically; keep it normal here */
.table-card #data-table thead th {
  position: static;
  box-shadow: none;
}

/* Mobile: sidebar becomes top bar */
@media (max-width: 860px) {
  .app-shell {
    flex-direction: column
  }

  .app-sidebar {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid rgba(214, 179, 106, .18);
  }

  .app-main {
    padding: 18px
  }
}

/* --- Lighten admin theme + remove outer margins --- */
:root {
  --bg: #f6f1e6;
  --ink: #1a1a1a;
  --muted: #5f5a50;

  --panel: rgba(255, 255, 255, .72);
  --card: rgba(255, 255, 255, .82);

  --gold: #b0883b;
  --gold2: #caa55a;
  --ruby: #8b1f2f;

  --border: rgba(176, 136, 59, .28);
  --shadow: rgba(0, 0, 0, .12);
}

html,
body {
  height: 100%;
}

body {
  padding: 0 !important;
  background-color: var(--bg) !important;
  color: var(--ink) !important;
}

/* Softer, brighter background */
body::before {
  background:
    radial-gradient(900px 650px at 12% 10%, rgba(202, 165, 90, .22), transparent 60%),
    radial-gradient(850px 600px at 88% 15%, rgba(139, 31, 47, .14), transparent 60%),
    radial-gradient(900px 700px at 50% 90%, rgba(124, 77, 255, .10), transparent 65%),
    repeating-linear-gradient(135deg, rgba(176, 136, 59, .06) 0 1px, transparent 1px 16px) !important;
  opacity: 1 !important;
}

/* App shell must touch edges */
.app-shell {
  min-height: 100vh;
}

/* Sidebar lighter */
.app-sidebar {
  background: rgba(255, 255, 255, .55) !important;
  border-right: 1px solid rgba(176, 136, 59, .28) !important;
  box-shadow: 8px 0 24px rgba(0, 0, 0, .06);
}

/* Main without big padding */
.app-main {
  padding: 22px 24px 28px 24px !important;
}

/* Header line softer */
.app-header {
  border-bottom: 1px solid rgba(176, 136, 59, .22) !important;
}

/* Card becomes parchment */
.card {
  background: rgba(255, 255, 255, .82) !important;
  border: 1px solid rgba(176, 136, 59, .26) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .10) !important;
}

/* Inputs lighter */
input {
  background: rgba(255, 255, 255, .9) !important;
  color: var(--ink) !important;
  border: 1px solid rgba(176, 136, 59, .28) !important;
}

/* Links */
a {
  color: #7a5b1f !important;
}

a:hover {
  color: #5f4515 !important;
}

/* Buttons: keep fantasy but lighter */
button {
  background: linear-gradient(180deg, rgba(202, 165, 90, .95), rgba(176, 136, 59, .90)) !important;
  border-color: rgba(176, 136, 59, .45) !important;
  color: #1a1206 !important;
  box-shadow: 0 10px 18px rgba(0, 0, 0, .10) !important;
}

.logout-btn,
button#logout {
  background: rgba(139, 31, 47, .10) !important;
  color: #6a1421 !important;
  border-color: rgba(139, 31, 47, .28) !important;
}

/* Tables */
th {
  color: #6b4d14 !important;
}

th,
td {
  border-bottom: 1px solid rgba(176, 136, 59, .18) !important;
}

/* Mobile: keep edge-to-edge */
@media (max-width: 860px) {
  .app-main {
    padding: 16px !important;
  }
}

/* --- Sidebar light cleanup (remove remaining dark blocks) --- */
.brand-mark {
  background: linear-gradient(180deg, rgba(202, 165, 90, .35), rgba(255, 255, 255, .55)) !important;
  border-color: rgba(176, 136, 59, .35) !important;
  box-shadow: 0 10px 16px rgba(0, 0, 0, .08) !important;
}

.sidebar-top {
  background: rgba(255, 255, 255, .72) !important;
  border-color: rgba(176, 136, 59, .22) !important;
}

.nav a {
  color: var(--ink) !important;
}

.nav a.active {
  background: rgba(202, 165, 90, .18) !important;
  border-color: rgba(176, 136, 59, .28) !important;
}

.nav-group-title {
  margin: 14px 8px 6px 8px;
  font-size: 12px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: rgba(95, 90, 80, .85);
}

.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(176, 136, 59, .18);
}

.nav-sub a {
  padding: 9px 12px;
  border-radius: 14px;
}

/* --- Collapsible nav group (Usuarios) --- */
.nav-group {
  margin-top: 8px;
}

.nav-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.nav-toggle:hover {
  border-color: rgba(176, 136, 59, .22);
  background: rgba(176, 136, 59, .06);
}

.nav-toggle.active {
  border-color: rgba(176, 136, 59, .28);
  background: rgba(202, 165, 90, .18);
}

.nav-toggle .left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.nav-toggle small {
  color: var(--muted);
}

.chev {
  width: 28px;
  height: 28px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(176, 136, 59, .20);
  background: rgba(255, 255, 255, .55);
  transition: transform .15s ease;
}

.nav-group[data-open="true"] .chev {
  transform: rotate(180deg);
}

.nav-sub {
  display: none;
}

.nav-group[data-open="true"] .nav-sub {
  display: flex;
}


select {
  background: rgba(5, 4, 10, .6);
  color: var(--ink);
  border: 1px solid rgba(214, 179, 106, .22);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(176, 136, 59, .35);
  background: rgba(255, 248, 220, .65);
  font-weight: 700;
  font-size: .85rem;
  color: var(--ink)
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .85em;
  background: rgba(15, 23, 42, .06);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, .08)
}

.card-mini {
  border: 1px solid rgba(176, 136, 59, .22);
  background: rgba(255, 248, 220, .55);
  border-radius: 16px;
  padding: 14px 16px
}

/* Modal readability: parchment cards use dark ink */
.card-mini,
.pill {
  color: #140a10;
}

.card-mini small {
  color: rgba(20, 10, 16, .78);
}

/* Tabs (admin edit forms) */
.tabs {
  /*
    Tabs layout
    - The old flex row caused the tab list (first child) and panels (other children)
      to appear side-by-side.
    - We want tabs ALWAYS on top, panels below.
  */
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  margin: 0 0 14px 0;
}

.tabs-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tab-btn {
  appearance: none;
  border: 1px solid rgba(176, 136, 59, .28);
  background: rgba(255, 248, 220, .55);
  color: #140a10;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.tab-btn:hover {
  border-color: rgba(176, 136, 59, .55);
}

.tab-btn.tab-active {
  background: rgba(176, 136, 59, .18);
  border-color: rgba(176, 136, 59, .75);
}

/* spell list styling */
.spell-level {
  margin-bottom: 8px;
}
.spell-level strong {
  display: block;
  margin-bottom: 4px;
}
.spell-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  border-bottom: 1px solid #ddd;
}
.spell-row button {
  margin-left: 8px;
  font-size: 0.8em;
}
.spell-expand {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
}
.spell-desc {
  padding: 4px 12px;
  font-size: 0.9em;
  color: #444;
  background: #fafafa;
}

.tab-panel {
  display: none;
  padding-top: 6px;
}

.tab-panel.tab-panel-active {
  display: block;
  animation: tabFade .12s ease-out;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

@media (max-width: 980px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

@keyframes tabFade {
  from {
    opacity: .7;
    transform: translateY(2px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.modal-body h3 {
  color: var(--gold2);
}

pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .85rem;
  background: rgba(15, 23, 42, .06);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 14px;
  padding: 12px 14px
}


/* Checkbox groups (languages) */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* characters-actions-spacing-fix */
.table-actions .btn,
.actions .btn {
  margin-right: 8px;
}

.table-actions .btn:last-child,
.actions .btn:last-child {
  margin-right: 0;
}


/* characters-buttons-spacing-v2 */
td .btn+.btn {
  margin-left: 10px !important;
}

.table td .btn+.btn {
  margin-left: 10px !important;
}


/* characters-buttons-spacing-v3 */
td .table-action+.table-action {
  margin-left: 10px !important;
}

.table td .table-action+.table-action {
  margin-left: 10px !important;
}

.table-action {
  display: inline-flex;
  align-items: center;
}


/* checklist */
.checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 0;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(176, 136, 59, .22);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
}

.check-item input {
  transform: translateY(1px);
}

.field-block {
  grid-column: 1/-1;
}

.field-label {
  font-weight: 700;
  margin-top: 4px;
}

.muted {
  color: rgba(95, 90, 80, .85);
}

.other-info-head {
  margin-bottom: 14px;
}

.other-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.other-info-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(176, 136, 59, .26);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 251, 238, .78), rgba(255, 247, 223, .65));
  padding: 14px;
  font-weight: 700;
  color: #2a1b08;
}

.other-info-card small {
  font-weight: 500;
  line-height: 1.4;
}

.other-info-card-wide {
  grid-column: 1 / -1;
}

.other-info-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
  border-radius: 12px;
  border: 1px solid rgba(176, 136, 59, .35);
  background: rgba(255, 255, 255, .88);
  color: #1f1407;
  padding: 10px 12px;
}

.other-info-textarea:focus {
  outline: none;
  border-color: rgba(176, 136, 59, .7);
  box-shadow: 0 0 0 3px rgba(176, 136, 59, .16);
}

.other-info-display-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.other-info-display-card {
  border: 1px solid rgba(176, 136, 59, .24);
  border-radius: 14px;
  background: rgba(255, 248, 220, .46);
  padding: 12px;
}

.other-info-display-card h4 {
  margin: 0 0 8px 0;
  font-size: .95rem;
}

.other-info-display-card p,
.other-info-display-card div {
  margin: 0;
  line-height: 1.45;
}

.other-info-display-card-wide {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .other-info-grid,
  .other-info-display-grid {
    grid-template-columns: 1fr;
  }

  .other-info-card-wide,
  .other-info-display-card-wide {
    grid-column: auto;
  }
}