/* ============================================================
   TOPBAR — barra superior, breadcrumb, menú de usuario
============================================================ */

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }


.topbar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky; top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }

.menu-btn {
  display: none;
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--c-primary);
  flex-shrink: 0;
}
.menu-btn svg { width: 22px; height: 22px; }

/* Breadcrumb */
.breadcrumb {
  font-size: 15px;
  color: var(--c-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.breadcrumb .sep {
  display: inline-flex;
  color: var(--c-muted);
  opacity: .55;
}
.breadcrumb .sep svg { width: 14px; height: 14px; }
.breadcrumb .crumb { display: inline-flex; align-items: center; cursor: default; }
.breadcrumb .crumb.current { color: var(--c-primary); font-weight: 600; }
.breadcrumb .crumb-link {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--c-muted);
  cursor: pointer;
  transition: color .15s;
}
.breadcrumb .crumb-link:hover { color: var(--c-primary); }

/* Avatar */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
}

/* User menu */
.user-menu { position: relative; flex-shrink: 0; }
.user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  background: transparent;
  border: none;
  padding: 4px 8px 4px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--c-primary);
  transition: background .15s;
}
.user:hover { background: var(--c-bg); }
.user-name { display: inline; font-weight: 500; }
.user-chev { width: 14px; height: 14px; color: var(--c-muted); transition: transform .2s; }
.user-menu.open .user-chev { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(31, 42, 40, .12);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 60;
}
.user-menu.open .user-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
}
.dropdown-user-info { display: flex; flex-direction: column; min-width: 0; }
.dropdown-user-info strong { font-size: 13px; font-weight: 600; color: var(--c-primary); }
.dropdown-user-info span {
  font-size: 11.5px; color: var(--c-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dropdown-divider {
  height: 1px;
  background: var(--c-border);
  margin: 4px 0;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--c-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.dropdown-item:hover { background: var(--c-bg); }
.dropdown-item svg { width: 17px; height: 17px; color: var(--c-muted); flex-shrink: 0; }
.dropdown-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--c-primary);
  font-weight: 600;
  background: var(--c-bg);
  padding: 2px 8px;
  border-radius: 10px;
}
.dropdown-danger { color: #b91c1c; }
.dropdown-danger svg { color: #b91c1c; }
.dropdown-danger:hover { background: #fef2f2; }

.dropdown-admin { color: var(--c-accent); text-decoration: none; }
.dropdown-admin svg { color: var(--c-accent); }
.dropdown-admin:hover { background: #E6F8F8; }

@media (max-width: 768px) {
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .user-name { display: none; }
}
