:root {
  --ichtus-cyan: #00d4e8;
  --ichtus-blue: #0077e3;
  --ichtus-teal: #4ecdc4;
  --ichtus-dark: #272727;
  --ichtus-navy: #1a2332;
  --ichtus-navy-dark: #121a26;
  --ichtus-navy-hover: #243044;
  --ichtus-border: rgba(255, 255, 255, 0.08);
  --ichtus-gradient: linear-gradient(135deg, var(--ichtus-cyan) 0%, var(--ichtus-blue) 100%);
  --sidebar-w: 16rem;
}

* { box-sizing: border-box; }

body.admin-ichtus {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  background: var(--ichtus-navy);
  color: #cbd5e1;
  min-height: 100vh;
  color-scheme: dark;
}

.admin-app {
  min-height: 100vh;
  display: flex;
}

.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--ichtus-navy-dark);
  border-right: 1px solid var(--ichtus-border);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.admin-sidebar.is-open {
  transform: translateX(0);
}

@media (min-width: 992px) {
  .admin-sidebar {
    transform: translateX(0);
  }
}

.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 30;
}

.admin-sidebar-backdrop.is-open { display: block; }

@media (min-width: 992px) {
  .admin-sidebar-backdrop { display: none !important; }
}

.admin-brand-box {
  padding: 1.25rem;
  border-bottom: 1px solid var(--ichtus-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-brand-box img {
  max-height: 64px;
  width: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
}

.admin-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.admin-nav-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  padding: 0 0.75rem;
  margin: 0.75rem 0 0.5rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 0.15rem;
}

.admin-nav-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; }

.admin-nav-link:hover {
  color: #fff;
  background: var(--ichtus-navy-hover);
}

.admin-nav-link.active {
  background: var(--ichtus-teal);
  color: #083344;
  box-shadow: 0 8px 24px rgba(78, 205, 196, 0.25);
}

.admin-nav-link.active i { color: #083344; }

.admin-nav-group-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.admin-nav-group-title.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ichtus-border);
}

.admin-nav-sub {
  margin: 0.25rem 0 0.5rem 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--ichtus-border);
}

.admin-nav-sub a {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.admin-nav-sub a:hover { color: #fff; background: var(--ichtus-navy-hover); }

.admin-nav-sub a.active {
  color: var(--ichtus-teal);
  background: rgba(78, 205, 196, 0.12);
}

.admin-sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--ichtus-border);
}

.admin-user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.admin-user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(78, 205, 196, 0.15);
  border: 1px solid rgba(78, 205, 196, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.admin-user-avatar img { width: 1.25rem; height: auto; }

.admin-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #94a3b8;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-logout-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.admin-main {
  flex: 1;
  min-width: 0;
  margin-left: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  .admin-main { margin-left: var(--sidebar-w); }
}

.admin-topbar {
  height: 4rem;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--ichtus-border);
  background: rgba(18, 26, 38, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

@media (min-width: 576px) {
  .admin-topbar { padding: 0 2rem; }
}

.admin-menu-toggle {
  display: inline-flex;
  padding: 0.4rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

@media (min-width: 992px) {
  .admin-menu-toggle { display: none; }
}

.admin-topbar-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.admin-topbar-title::before {
  content: "";
  width: 4px;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--ichtus-teal);
  opacity: 0.75;
  flex-shrink: 0;
}

.admin-topbar-title h1 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-badge {
  display: none;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--ichtus-teal);
  background: rgba(78, 205, 196, 0.12);
  border: 1px solid rgba(78, 205, 196, 0.25);
}

@media (min-width: 576px) {
  .admin-badge { display: inline-flex; }
}

.admin-link-site {
  font-size: 0.75rem;
  color: #94a3b8;
  text-decoration: none;
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.admin-link-site:hover { color: #fff; }

@media (min-width: 576px) {
  .admin-link-site { display: inline-flex; }
}

.admin-content {
  flex: 1;
  padding: 1rem;
}

@media (min-width: 576px) {
  .admin-content { padding: 1.5rem 2rem 2rem; }
}

.admin-subnav {
  margin-bottom: 1.75rem;
}

.admin-subnav-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.65rem;
}

.admin-subnav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-subnav-tabs a {
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--ichtus-border);
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.2s;
}

.admin-subnav-tabs a:hover {
  color: #fff;
  border-color: rgba(78, 205, 196, 0.35);
}

.admin-subnav-tabs a.active {
  background: var(--ichtus-teal);
  border-color: var(--ichtus-teal);
  color: #083344;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(78, 205, 196, 0.2);
}

.admin-page-head {
  margin-bottom: 1.5rem;
}

.admin-page-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.admin-page-head p {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

.admin-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ichtus-border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.admin-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ichtus-border);
  border-radius: 16px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

.admin-stat-card:hover {
  border-color: rgba(78, 205, 196, 0.45);
  transform: translateY(-2px);
}

.admin-stat-card small {
  color: #64748b;
  font-size: 0.75rem;
}

.admin-stat-card strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.25rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--ichtus-border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th,
.admin-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--ichtus-border);
  vertical-align: middle;
}

.admin-table th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  background: rgba(0, 0, 0, 0.15);
}

.admin-table tr:last-child td { border-bottom: 0; }

.admin-table td { color: #cbd5e1; }

.admin-form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
}

.admin-form-control,
.admin-form-select,
.admin-form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.875rem;
  color-scheme: dark;
}

.admin-form-select option,
.admin-form-select optgroup {
  background: #1a2332;
  color: #e2e8f0;
}

.admin-form-control:focus,
.admin-form-select:focus,
.admin-form-textarea:focus {
  outline: none;
  border-color: rgba(78, 205, 196, 0.55);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .admin-form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .admin-form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border-radius: 10px;
  border: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.admin-btn-primary {
  background: var(--ichtus-teal);
  color: #083344;
}

.admin-btn-primary:hover {
  background: #3dbdb5;
  color: #022;
}

.admin-btn-ghost {
  background: transparent;
  border: 1px solid var(--ichtus-border);
  color: #cbd5e1;
}

.admin-btn-ghost:hover {
  color: #fff;
  border-color: rgba(78, 205, 196, 0.35);
}

.admin-btn-danger {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.admin-btn-sm { padding: 0.35rem 0.65rem; font-size: 0.75rem; }

.admin-save-bar {
  position: sticky;
  bottom: 0;
  margin-top: 1.5rem;
  padding: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--ichtus-border);
  background: linear-gradient(to top, var(--ichtus-navy) 70%, transparent);
}

.admin-alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.admin-alert-success {
  background: rgba(78, 205, 196, 0.12);
  border: 1px solid rgba(78, 205, 196, 0.35);
  color: #a7f3d0;
}

.admin-alert-danger {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.admin-thumb { height: 48px; width: auto; border-radius: 8px; }

/* Login */
.auth-ichtus-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--ichtus-navy);
  background-image: radial-gradient(ellipse at top, rgba(0, 212, 232, 0.08), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(0, 119, 227, 0.12), transparent 50%);
}

.auth-ichtus-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ichtus-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.auth-ichtus-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-ichtus-logo img {
  max-height: 72px;
  background: #fff;
  border-radius: 14px;
  padding: 0.65rem 1rem;
}

.auth-ichtus-card h1 {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.35rem;
}

.auth-ichtus-card p.sub {
  text-align: center;
  color: #64748b;
  font-size: 0.8125rem;
  margin: 0 0 1.5rem;
}

/* Animaciones y formularios mejorados */
@keyframes adminFadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes adminSpin {
  to { transform: rotate(360deg); }
}

.admin-animate-in {
  animation: adminFadeInUp 0.45s ease both;
}

.admin-content > .admin-animate-in:nth-child(2) { animation-delay: 0.05s; }
.admin-content > .admin-animate-in:nth-child(3) { animation-delay: 0.1s; }

.admin-spin { animation: adminSpin 0.8s linear infinite; display: inline-block; }

.admin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ichtus-teal);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: transform 0.2s, color 0.2s;
}

.admin-back-link:hover { color: #fff; transform: translateX(-3px); }

.admin-page-head-main { flex: 1; min-width: 0; }

.admin-form-shell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--ichtus-border);
  border-radius: 18px;
  padding: 0.25rem 1.25rem 1.25rem;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

@media (min-width: 768px) {
  .admin-form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .admin-form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .admin-field-span-2 { grid-column: span 2; }
}

.admin-field { min-width: 0; }

.admin-required { color: #f87171; margin-left: 0.15rem; }

.admin-field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

.admin-field-error {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-form-control.is-invalid,
.admin-form-select.is-invalid,
.admin-form-textarea.is-invalid {
  border-color: rgba(248, 113, 113, 0.65);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.admin-form-section {
  border: 1px solid var(--ichtus-border);
  border-radius: 14px;
  margin-bottom: 1rem;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.12);
}

.admin-form-section-head {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.admin-form-section-head::-webkit-details-marker { display: none; }

.admin-form-section-head:hover { background: rgba(255, 255, 255, 0.03); }

.admin-form-section-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(78, 205, 196, 0.12);
  color: var(--ichtus-teal);
  flex-shrink: 0;
}

.admin-form-section-text { flex: 1; min-width: 0; }
.admin-form-section-text strong { display: block; color: #e2e8f0; font-size: 0.9rem; }
.admin-form-section-text small { display: block; color: #64748b; font-size: 0.75rem; margin-top: 0.15rem; }

.admin-form-section-chevron {
  color: #64748b;
  transition: transform 0.25s ease;
}

.admin-form-section[open] .admin-form-section-chevron { transform: rotate(180deg); }

.admin-form-section-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--ichtus-border);
  animation: adminFadeInUp 0.3s ease;
}

.admin-switch {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  min-height: 2.5rem;
}

.admin-switch input { position: absolute; opacity: 0; pointer-events: none; }

.admin-switch-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #334155;
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}

.admin-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.admin-switch input:checked + .admin-switch-ui {
  background: var(--ichtus-teal);
}

.admin-switch input:checked + .admin-switch-ui::after {
  transform: translateX(20px);
}

.admin-switch-label { font-size: 0.8125rem; color: #cbd5e1; font-weight: 500; }

.admin-file-drop {
  display: block;
  border: 2px dashed rgba(78, 205, 196, 0.35);
  border-radius: 14px;
  padding: 1rem 1.25rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  background: rgba(78, 205, 196, 0.04);
}

.admin-file-drop-preview {
  margin: 0 auto 1rem;
}

.admin-media-preview {
  overflow: hidden;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.admin-media-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-media-preview--sm {
  width: 52px;
  height: 52px;
}

.admin-media-preview--md {
  width: 80px;
  height: 80px;
}

.admin-media-preview--lg {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 3 / 4;
  margin-left: auto;
  margin-right: auto;
}

.admin-media-placeholder {
  width: 100%;
  height: 100%;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem;
  color: #64748b;
  background: rgba(255, 255, 255, 0.03);
}

.admin-media-preview--lg .admin-media-placeholder {
  min-height: 160px;
}

.admin-media-placeholder i {
  font-size: 1.75rem;
  color: rgba(78, 205, 196, 0.45);
}

.admin-media-preview--sm .admin-media-placeholder i {
  font-size: 1.35rem;
}

.admin-media-placeholder span {
  font-size: 0.65rem;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
}

.admin-media-preview--sm .admin-media-placeholder span {
  display: none;
}

.admin-file-drop:hover,
.admin-file-drop.is-dragover {
  border-color: var(--ichtus-teal);
  background: rgba(78, 205, 196, 0.1);
  transform: translateY(-1px);
}

.admin-file-input { display: none; }

.admin-file-drop-inner i {
  font-size: 1.75rem;
  color: var(--ichtus-teal);
  display: block;
  margin-bottom: 0.35rem;
}

.admin-file-drop-inner strong { display: block; color: #e2e8f0; font-size: 0.875rem; }
.admin-file-drop-inner small { display: block; color: #64748b; font-size: 0.75rem; margin-top: 0.25rem; }

.admin-file-name {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--ichtus-teal);
  font-weight: 600;
}

.admin-file-preview {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.admin-file-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-file-preview code {
  font-size: 0.7rem;
  color: #94a3b8;
  word-break: break-all;
}

.admin-save-bar-hint {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-save-bar-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.admin-btn-submit .admin-btn-loading { display: none; }
.admin-btn-submit.is-loading .admin-btn-text { display: none; }
.admin-btn-submit.is-loading .admin-btn-loading { display: inline-flex; align-items: center; gap: 0.35rem; }
.admin-btn-submit.is-loading { pointer-events: none; opacity: 0.85; }

.admin-table tbody tr {
  transition: background 0.2s;
}

.admin-table tbody tr:hover td {
  background: rgba(78, 205, 196, 0.05);
}

.admin-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #64748b;
}

.admin-empty i {
  font-size: 2rem;
  color: var(--ichtus-teal);
  opacity: 0.6;
  display: block;
  margin-bottom: 0.5rem;
}

.admin-alert {
  animation: adminFadeInUp 0.35s ease;
}

.admin-toolbar-meta {
  font-size: 0.8125rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(78, 205, 196, 0.15);
  color: var(--ichtus-teal);
  font-weight: 800;
  font-size: 0.75rem;
}

.admin-btn-add {
  box-shadow: 0 4px 14px rgba(78, 205, 196, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.admin-btn-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.35);
}

.admin-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-pill.is-on {
  background: rgba(78, 205, 196, 0.15);
  color: #5eead4;
}

.admin-pill.is-off {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.admin-pill.is-warn {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
}

.admin-dl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin: 0;
}

.admin-dl-grid dt {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.admin-dl-grid dd {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.9375rem;
}

.admin-dl-grid .admin-dl-span-2 {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .admin-dl-grid {
    grid-template-columns: 1fr;
  }
}

.admin-cell-title { color: #e2e8f0; font-weight: 600; }
.admin-cell-muted { font-size: 0.75rem; color: #64748b; display: block; margin-top: 0.15rem; }
.admin-cell-sub { font-size: 0.75rem; color: #94a3b8; margin-top: 0.35rem; padding-left: 0.5rem; }

.admin-cell-thumb {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.admin-thumb-wide { max-width: 120px; height: 40px; object-fit: contain; background: rgba(0,0,0,.2); }

.admin-inline-code {
  color: var(--ichtus-teal);
  font-size: 0.8125rem;
  background: rgba(0,0,0,.2);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.admin-row-actions {
  text-align: right;
  white-space: nowrap;
}

.admin-inline-form {
  display: inline;
  margin-left: 0.35rem;
}

.admin-form-section:nth-child(1) { animation-delay: 0.04s; }
.admin-form-section:nth-child(2) { animation-delay: 0.08s; }
.admin-form-section:nth-child(3) { animation-delay: 0.12s; }
.admin-form-section:nth-child(4) { animation-delay: 0.16s; }

/* Toasts (guardar / eliminar / editar) */
.admin-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.admin-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  animation: adminToastIn 0.35s ease both;
  border: 1px solid transparent;
}

@keyframes adminToastIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.admin-toast-success {
  background: rgba(15, 35, 42, 0.95);
  border-color: rgba(78, 205, 196, 0.35);
  color: #b8e8e3;
}

.admin-toast-danger {
  background: rgba(35, 20, 24, 0.95);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.admin-toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.05rem; }
.admin-toast-success .admin-toast-icon { color: var(--ichtus-teal); }
.admin-toast-danger .admin-toast-icon { color: #f87171; }

.admin-toast-text { flex: 1; }

.admin-toast-close {
  background: transparent;
  border: 0;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  padding: 0.15rem;
  line-height: 1;
}

.admin-toast-close:hover { opacity: 1; }

.admin-toast.is-leaving {
  animation: adminToastOut 0.25s ease forwards;
}

@keyframes adminToastOut {
  to { opacity: 0; transform: translateX(12px); }
}

/* Menú: orden y visibilidad */
.admin-col-grip { width: 2.5rem; text-align: center; }

.admin-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  color: #64748b;
  cursor: grab;
  transition: color 0.2s, background 0.2s;
}

.admin-drag-handle:hover {
  color: var(--ichtus-teal);
  background: rgba(78, 205, 196, 0.08);
}

.admin-menu-row.is-dragging {
  opacity: 0.55;
}

.admin-menu-row.is-drag-over td {
  box-shadow: inset 0 2px 0 var(--ichtus-teal);
}

.admin-menu-row.is-hidden-tab .admin-cell-title {
  opacity: 0.55;
}

.admin-order-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.admin-order-num {
  min-width: 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
}

.admin-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.admin-order-btn:hover {
  color: var(--ichtus-teal);
  border-color: rgba(78, 205, 196, 0.35);
  background: rgba(78, 205, 196, 0.06);
}

.admin-order-btn-sub {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.65rem;
}

.admin-sub-order {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 0.25rem;
  gap: 0.1rem;
}

.admin-cell-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.admin-switch-sm .admin-switch-ui {
  width: 38px;
  height: 22px;
}

.admin-switch-sm .admin-switch-ui::after {
  width: 16px;
  height: 16px;
}

.admin-switch-sm input:checked + .admin-switch-ui::after {
  transform: translateX(16px);
}

.admin-switch-xs .admin-switch-ui {
  width: 32px;
  height: 18px;
}

.admin-switch-xs .admin-switch-ui::after {
  width: 12px;
  height: 12px;
  top: 3px;
  left: 3px;
}

.admin-switch-xs input:checked + .admin-switch-ui::after {
  transform: translateX(14px);
}

.admin-switch-inline {
  margin-left: auto;
}

/* —— Modal inactividad —— */
.admin-idle-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.admin-idle-modal[hidden] {
  display: none !important;
}

.admin-idle-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.admin-idle-modal-card {
  position: relative;
  width: min(100%, 22rem);
  background: var(--ichtus-navy-dark);
  border: 1px solid var(--ichtus-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.admin-idle-modal-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-idle-modal-card p {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.5;
}

.admin-idle-countdown {
  margin: 1rem 0 1.25rem !important;
  color: #e2e8f0 !important;
}

.admin-idle-countdown strong {
  color: var(--ichtus-cyan);
  font-size: 1.125rem;
}

.admin-idle-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-idle-actions .admin-btn {
  width: 100%;
  justify-content: center;
}

/* —— Bot asistente —— */
.admin-bot-widget {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 180;
}

.admin-bot-launcher {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.admin-bot-launcher-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.admin-bot-launcher-bubble {
  position: relative;
  background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.5rem 0.85rem 0.55rem;
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 8px 22px rgba(255, 107, 53, 0.35);
  max-width: 11rem;
  line-height: 1.25;
  margin-right: 0.35rem;
  margin-bottom: -0.35rem;
  z-index: 2;
}

.admin-bot-launcher-bubble::after {
  content: "";
  position: absolute;
  right: 1.1rem;
  bottom: -0.45rem;
  width: 1rem;
  height: 1rem;
  background: #ff7438;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  transform: rotate(12deg);
  border-radius: 0 0 3px 0;
}

.admin-bot-launcher-avatar {
  z-index: 1;
}

.admin-bot-avatar-wrap {
  --bot-avatar-size: 40px;
  width: var(--bot-avatar-size);
  height: var(--bot-avatar-size);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.admin-bot-avatar-wrap--sm {
  --bot-avatar-size: 34px;
  border-width: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.admin-bot-avatar-wrap--md {
  --bot-avatar-size: 40px;
  border-width: 2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.admin-bot-avatar-wrap--lg {
  --bot-avatar-size: 72px;
}

.admin-bot-avatar-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.admin-bot-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.65rem);
  width: min(22rem, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-bot-panel[hidden] {
  display: none !important;
}

.admin-bot-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: linear-gradient(135deg, #0077e3 0%, #00d4e8 100%);
  color: #fff;
}

.admin-bot-panel-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-bot-panel-title strong {
  display: block;
  font-size: 0.88rem;
}

.admin-bot-panel-title span {
  display: block;
  font-size: 0.68rem;
  opacity: 0.9;
}

.admin-bot-panel-avatar {
  border-color: rgba(255, 255, 255, 0.9);
}

.admin-bot-close {
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
}

.admin-bot-messages {
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f8fafc;
}

.admin-bot-msg {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}

.admin-bot-msg--user {
  flex-direction: row-reverse;
}

.admin-bot-msg-avatar {
  flex-shrink: 0;
}

.admin-bot-bubble {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px 14px 14px 4px;
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #334155;
  max-width: 85%;
  white-space: pre-wrap;
}

.admin-bot-msg--user .admin-bot-bubble {
  background: #0077e3;
  border-color: #0077e3;
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}

.admin-bot-bubble p {
  margin: 0;
}

.admin-bot-bubble strong {
  font-weight: 700;
}

.admin-bot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.85rem 0.75rem;
  background: #f8fafc;
}

.admin-bot-suggestion {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-size: 0.68rem;
  line-height: 1.3;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

.admin-bot-suggestion:hover {
  border-color: #0077e3;
  color: #0077e3;
}

.admin-bot-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.admin-bot-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
}

.admin-bot-input:focus {
  outline: none;
  border-color: #0077e3;
  box-shadow: 0 0 0 3px rgba(0, 119, 227, 0.15);
}

.admin-bot-send {
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #0077e3 0%, #00d4e8 100%);
  color: #fff;
  cursor: pointer;
}

.admin-bot-send:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 767.98px) {
  .admin-bot-widget {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .admin-bot-avatar-wrap--lg {
    --bot-avatar-size: 62px;
  }

  .admin-bot-launcher-bubble {
    font-size: 0.66rem;
    max-width: 9.5rem;
  }
}
