/* Bloque Admin: shell del panel administrativo moderno, compacto e intuitivo. */
body.is-admin {
  min-width: 280px;
  background: var(--bg);
  color: var(--ink);
}
.admin-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 240px;
  background: #0f172a;
  color: #e2e8f0;
  border-right: 1px solid #1e293b;
}
html[data-theme="dark"] .admin-sidebar {
  background: #090e1a;
  border-right-color: #1a2536;
}
.sidebar-brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #1e293b;
  text-decoration: none;
}
.sidebar-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--ui-radius-sm);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  flex: none;
}
.sidebar-brand-mark img { width: 18px; height: 18px; }
.sidebar-brand-type {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-brand-type strong {
  font-size: 0.84rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #f8fafc;
}
.sidebar-brand-type small {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 1px;
}
.sidebar-navigation {
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-group-label {
  padding: 4px 10px 6px;
  color: #64748b;
  font-size: 0.63rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: var(--ui-radius-sm);
  color: #94a3b8;
  font-size: 0.81rem;
  font-weight: 550;
  line-height: 1.25;
  transition: all 0.12s ease;
  text-decoration: none;
}
.sidebar-link .ui-icon {
  width: 17px;
  height: 17px;
  color: #64748b;
  transition: color 0.12s;
}
.sidebar-link:not(.is-coming):hover {
  background: #1e293b;
  color: #f8fafc;
}
.sidebar-link:not(.is-coming):hover .ui-icon {
  color: #93c5fd;
}
.sidebar-link.is-active {
  background: #1e293b;
  color: #60a5fa;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #3b82f6;
}
.sidebar-link.is-active .ui-icon {
  color: #60a5fa;
}
.sidebar-link.is-coming {
  color: #475569;
  cursor: not-allowed;
}
.sidebar-link.is-coming .ui-icon { opacity: 0.5; }
.coming-dot {
  margin-left: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #475569;
}
.nav-active-indicator {
  height: 6px;
  width: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: #60a5fa;
}
.sidebar-bottom {
  margin: auto 12px 14px;
  padding: 10px 12px;
  border-top: 1px solid #1e293b;
  font-size: 0.69rem;
  color: #94a3b8;
}
.sidebar-bottom small {
  display: block;
  padding-left: 14px;
  color: #64748b;
  font-size: 0.66rem;
  margin-top: 2px;
}
.sidebar-system-dot {
  display: inline-block;
  background: #10b981;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}

/* Content Area */
.admin-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* Topbar */
.admin-topbar {
  min-height: 54px;
  padding: 0 clamp(16px, 2.5vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-location {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.topbar-separator { color: var(--line); font-size: 0.8rem; }
.topbar-title {
  font-size: 0.83rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.user-avatar {
  display: grid;
  place-items: center;
  flex: none;
  height: 28px;
  width: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 750;
}
.topbar-user-name {
  max-width: 135px;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.button-logout {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  padding: 4px 10px;
  min-height: 30px;
  gap: 5px;
  font-size: 0.76rem;
}
.button-logout:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.button-logout .ui-icon { width: 14px; height: 14px; }

/* Main & Footer */
.admin-main {
  flex: 1;
  width: min(100%, 1400px);
  padding: clamp(18px, 2.2vw, 32px) clamp(16px, 2.5vw, 36px) 40px;
  margin: 0 auto;
  min-width: 0;
}
.admin-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px clamp(16px, 2.5vw, 36px);
  color: var(--muted);
  font-size: 0.71rem;
}
.nav-toggle { display: none; }
.sidebar-overlay { display: none; }

/* Dashboard */
.welcome-banner {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  border-radius: var(--ui-radius-lg);
  color: #fff;
  padding: clamp(18px, 2.5vw, 28px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 0 0 18px;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.2);
}
.welcome-banner h1 {
  font-size: clamp(1.4rem, 2.3vw, 1.95rem);
  line-height: 1.2;
  margin-top: 5px;
  font-weight: 800;
}
.welcome-banner p {
  margin-top: 7px;
  color: #bfdbfe;
  font-size: 0.82rem;
  max-width: 540px;
  line-height: 1.5;
}
.welcome-banner .section-overline {
  color: #93c5fd;
  font-size: 0.69rem;
}
.welcome-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.welcome-actions .button {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  backdrop-filter: blur(4px);
}
.welcome-actions .button:hover {
  background: rgba(255, 255, 255, 0.28);
}
.welcome-actions .button-primary {
  background: #fff;
  color: #1e40af !important;
  border-color: #fff;
}
.welcome-actions .button-primary .ui-icon {
  stroke: #1e40af !important;
}
.welcome-actions .button .ui-icon {
  stroke: currentColor;
}
.welcome-actions .button-primary:hover {
  background: #f1f5f9;
}
.welcome-decoration {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--ui-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.welcome-decoration .ui-icon { width: 32px; height: 32px; }
.dashboard-section-title {
  margin: 20px 0 12px;
  font-size: 0.96rem;
  letter-spacing: -0.015em;
  font-weight: 750;
}
.quick-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--ui-shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}
.quick-card .feature-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--ui-radius-sm);
  background: var(--primary-light);
  color: var(--primary);
}
.quick-card h2 {
  font-size: 0.98rem;
  margin-top: 14px;
  font-weight: 700;
}
.quick-card p {
  flex: 1;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 5px 0 12px;
}
.quick-card .quick-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.77rem;
  font-weight: 650;
  color: var(--primary);
}
.quick-card .quick-link .ui-icon { width: 14px; height: 14px; }
.quick-card[href]:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Seguridad */
.security-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* Auditoría */
.audit-details {
  padding: 20px 24px;
}
.audit-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.audit-meta {
  background: var(--surface-2);
  border-radius: var(--ui-radius);
  padding: 10px 14px;
  min-width: 0;
}
.audit-meta dt {
  color: var(--muted);
  font-size: 0.7rem;
  margin-bottom: 2px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.audit-meta dd {
  font-size: 0.83rem;
  font-weight: 650;
  margin: 0;
  overflow-wrap: break-word;
}
.audit-section-heading {
  font-size: 0.95rem;
  margin: 20px 0 10px;
  font-weight: 750;
}
.audit-diff-value {
  margin: 0;
  font-family: inherit;
  font-size: 0.78rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  background: var(--surface-2);
  padding: 12px;
  border-radius: var(--ui-radius);
  border: 1px solid var(--line);
}
.audit-description {
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 16px;
  max-width: 80ch;
  font-size: 0.83rem;
}
