/* ═════════ Panel maestro: administración de cada empresa ═════════ */
.top__actions {
  display: flex;
  gap: 8px;
}
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #121a1c;
  color: var(--text);
  font: inherit;
  resize: vertical;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(165 239 117 / 0.15);
}
code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgb(255 255 255 / 0.07);
  font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.is-error {
  color: var(--bad) !important;
}
body.no-scroll {
  overflow: hidden;
}

/* Filtro */
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.seg button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.seg button[aria-pressed='true'] {
  background: rgb(255 255 255 / 0.08);
  color: var(--text);
}

/* Tarjeta: el banner es un botón que abre la administración */
button.co__banner {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}
.co.is-suspended .co__banner {
  filter: grayscale(0.8);
  opacity: 0.7;
}
.co__body h2 {
  font-size: 16.5px;
  overflow-wrap: anywhere;
}
.co__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--text-2);
}
.co__stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.co__stats strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.co__stats svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
}
.pill--muted {
  background: rgb(255 255 255 / 0.05);
  color: var(--text-3);
}

/* Panel lateral */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(2px);
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  border-left: 1px solid var(--line);
  background: var(--card);
  box-shadow: -30px 0 80px rgb(0 0 0 / 0.45);
  animation: slide 240ms var(--ease) both;
}
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: radial-gradient(ellipse at 0% 0%, color-mix(in srgb, var(--co-accent, var(--accent)) 22%, transparent), transparent 70%);
  border-bottom: 1px solid var(--line);
}
.drawer__who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.drawer__who h2 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.drawer__logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 92px;
  height: 46px;
  padding: 6px;
  border-radius: 10px;
  background: #0d1315;
  border: 1px solid var(--line);
}
.drawer__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.drawer__logo span {
  font-size: 20px;
  font-weight: 800;
  color: var(--co-accent, var(--accent));
}
.tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tabs button {
  position: relative;
  height: 40px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.tabs button[aria-selected='true'] {
  color: var(--text);
}
.tabs button[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--co-accent, var(--accent));
}
.tabs button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.drawer__body {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.drawer__body > p {
  margin: 0;
}
.section-title {
  margin: 6px 0 -4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stat {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-2);
}
.stat span {
  font-size: 12px;
  color: var(--text-2);
}
.stat strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.stat small {
  font-size: 11.5px;
  color: var(--text-3);
}
.stat .pill {
  margin-top: 2px;
  font-size: 12px;
}
.notice {
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgb(255 255 255 / 0.03);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}
.notice strong {
  color: var(--text);
}
.notice--bad {
  border-color: rgb(255 138 122 / 0.35);
  background: var(--bad-tint);
}
.notice--info {
  margin-top: 4px;
}
.stack {
  display: grid;
  gap: 14px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.row .spacer {
  flex: 1;
}

/* Marca */
.swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.swatch {
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.2);
  cursor: pointer;
  overflow: hidden;
}
.swatch[aria-pressed='true'] {
  box-shadow:
    0 0 0 2px var(--card),
    0 0 0 4px var(--text);
}
.swatch--custom {
  background: conic-gradient(#f43f5e, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #f43f5e);
}
.swatch--custom input {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  opacity: 0;
  cursor: pointer;
}
.hex {
  width: 104px;
  height: 34px;
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.fold {
  display: grid;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.fold summary {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
  cursor: pointer;
}
.fold[open] summary {
  margin-bottom: 4px;
}
.logo-slot {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.logo-slot > div:first-child {
  display: grid;
  gap: 2px;
}
.logo-slot small {
  font-size: 12px;
}
.logo-slot__stage {
  display: grid;
  place-items: center;
  height: 84px;
  padding: 10px;
  border-radius: 9px;
}
.logo-slot__stage--dark {
  background: #0d1315;
  border: 1px solid var(--line);
}
.logo-slot__stage--light {
  background: #ffffff;
}
.logo-slot__stage img {
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
}

/* Conexión */
.key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.key-row input {
  flex: 1 1 220px;
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Aviso flotante */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #22302f;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.45);
  transform: translateX(-50%);
  animation: pop 200ms var(--ease) both;
}

@keyframes slide {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
@media (max-width: 560px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .drawer__logo {
    width: 64px;
  }
}
