@layer base {
  html {
    font-family: "Poppins", system-ui, sans-serif;
  }
}

body {
    margin: 0;
}

/* ================================
   Admin layout
   ================================ */

.admin-layout {
  display: flex;
  height: 100vh;
  background-color: #F9FAFB;
}

/* Sidebar */
.admin-sidebar {
  width: 220px;
  min-width: 220px;
  background: #ffffff;
  border-right: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, min-width 0.2s ease;
  overflow: hidden;
}

.admin-sidebar.collapsed {
  width: 56px;
  min-width: 56px;
}

/* Header del sidebar */
.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
  border-bottom: 1px solid #E5E7EB;
  min-height: 56px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.admin-brand-icon {
  width: 28px;
  min-width: 28px;
  height: 28px;
  background-color: #4F46E5;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-brand-name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.15s;
}

.admin-sidebar.collapsed .admin-brand-name {
  opacity: 0;
  width: 0;
}

.admin-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #6B7280;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  min-width: 24px;
  transition: background 0.15s;
}

.admin-toggle-btn:hover {
  background-color: #F3F4F6;
}

.admin-sidebar.collapsed .admin-toggle-btn {
  margin: 0 auto;
}

/* Nav items */
.admin-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #6B7280;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.admin-nav-item:hover {
  background-color: #F3F4F6;
  color: #111827;
}

.admin-nav-item.active {
  background-color: #EEF2FF;
  color: #4F46E5;
}

.admin-nav-item svg {
  min-width: 18px;
}

.admin-nav-label {
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.15s;
}

.admin-sidebar.collapsed .admin-nav-label {
  opacity: 0;
  width: 0;
}

.admin-sidebar.collapsed .admin-nav-item {
  justify-content: center;
  padding: 8px;
}

/* Footer del sidebar */
.admin-sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  overflow: hidden;
}

.admin-avatar {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #EEF2FF;
  color: #4F46E5;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-user-info {
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.15s;
}

.admin-sidebar.collapsed .admin-user-info {
  opacity: 0;
  width: 0;
}

.admin-user-name {
  font-size: 12px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.admin-user-role {
  font-size: 11px;
  color: #9CA3AF;
}

.admin-logout-btn {
  width: 100%;
  padding: 6px 10px;
  background: none;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 12px;
  color: #6B7280;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.15s;
}

.admin-logout-btn:hover {
  background-color: #FEF2F2;
  color: #B91C1C;
  border-color: #FECACA;
}

.admin-sidebar.collapsed .admin-logout-btn {
  opacity: 0;
  pointer-events: none;
}

/* Main */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-topbar {
  height: 56px;
  min-height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.admin-page-title {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-content {
  flex: 1;
  padding: 24px 20px;
  overflow-y: auto;
}

/* Flash messages */
.admin-flash {
  padding: 10px 20px;
  font-size: 13px;
}

.admin-flash--notice {
  background-color: #F0FDF4;
  color: #166534;
  border-bottom: 1px solid #BBF7D0;
  z-index: 10;
}

.admin-flash--alert {
  background-color: #FEF2F2;
  color: #991B1B;
  border-bottom: 1px solid #FECACA;
  z-index: 10;
}

/* TOP BAR BUTTONS */

.admin-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
  transition: background 0.15s;
}

.admin-icon-btn:hover {
  background-color: #F3F4F6;
}

/* Dashboard */

.admin-stat-card {
  background-color: #F9FAFB;
  border-radius: 8px;
  padding: 16px;
}

.admin-stat-label {
  font-size: 12px;
  color: #6B7280;
  margin-bottom: 6px;
}

.admin-stat-value {
  font-size: 24px;
  font-weight: 500;
  color: #111827;
}

.admin-new-user-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: #111827;
  color: white;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  width: fit-content; /* 🔥 clave */
  white-space: nowrap;
  flex-shrink: 0; /* 🔥 evita que se estire */
  gap: 8px;
}

.admin-new-user-btn:hover {
  background: #1f2937;
}